Aladdin - Scala Bugtracking
[#632] project: compiler priority: medium category: bug
submitter assigned to status date submitted
Iulian Iulian fixed 2006-06-20 10:22:32.0
subject Finally handlers are executed before exception handlers
code
object Test {
  def main(args: Array[String]): Unit = try {
    error("Test");
  } catch {
    case e: Throwable => Console.println("Exception handler");
  } finally {
    Console.println("Finally handler");
  }
}
what happened
Finally handler
Exception handler
what expected
Exception handler
Finally handler
The 'Scala Language Spec' says a block 'try {..} catch {..} finally {..}' is equivalent to try { try {...} catch {..} } finally {..}.
[back to overview]
Changes of this bug report
Iulian  edited on  2006-06-20 10:23:01.0
Iulian  edited on  2006-06-20 13:35:19.0