summaryrefslogtreecommitdiff
path: root/test/files/run/exceptions-2.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run/exceptions-2.scala')
-rw-r--r--test/files/run/exceptions-2.scala18
1 files changed, 18 insertions, 0 deletions
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
}
}