diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2008-02-26 08:12:56 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2008-02-26 08:12:56 +0000 |
commit | bcbeab74566f835219dabf0bbb172fd028a8a032 (patch) | |
tree | b83d917d906ec690efbb01f2fdf80e32312c3de4 /test | |
parent | 0c6ab69119308a4248e416ce325d1a9e1c649516 (diff) | |
download | scala-bcbeab74566f835219dabf0bbb172fd028a8a032.tar.gz scala-bcbeab74566f835219dabf0bbb172fd028a8a032.tar.bz2 scala-bcbeab74566f835219dabf0bbb172fd028a8a032.zip |
Fixed #466.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/exceptions-2.check | 4 | ||||
-rw-r--r-- | test/files/run/exceptions-2.scala | 18 |
2 files changed, 22 insertions, 0 deletions
diff --git a/test/files/run/exceptions-2.check b/test/files/run/exceptions-2.check index 6f6af38e29..86fc91b2a2 100644 --- a/test/files/run/exceptions-2.check +++ b/test/files/run/exceptions-2.check @@ -50,3 +50,7 @@ finally inside finally Outer finally Throw in catch and finally: ABC +Return with finally clause that cleans the stack +Normal execution... +inner finally +Outer finally diff --git a/test/files/run/exceptions-2.scala b/test/files/run/exceptions-2.scala index 1c6245b891..91d294c8d7 100644 --- a/test/files/run/exceptions-2.scala +++ b/test/files/run/exceptions-2.scala @@ -255,6 +255,21 @@ object Test { } + def returnWithFinallyClean: Int = try { + try { + Console.println("Normal execution..."); + return 10 + Console.println("non reachable code"); + 11 + } finally { + Console.println("inner finally"); + } + } finally { + Console.println("Outer finally"); + try { 1 } catch { case e: java.io.IOException => () } + } + + def main(args: Array[String]): Unit = { Console.println("nested1: "); execute(nested1); @@ -310,5 +325,8 @@ object Test { Console.println("Throw in catch and finally:"); execute(tryThrowFinally); + + Console.println("Return with finally clause that cleans the stack") + returnWithFinallyClean } } |