diff options
Diffstat (limited to 'test/files')
-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 } } |