From bcbeab74566f835219dabf0bbb172fd028a8a032 Mon Sep 17 00:00:00 2001 From: Iulian Dragos Date: Tue, 26 Feb 2008 08:12:56 +0000 Subject: Fixed #466. --- test/files/run/exceptions-2.check | 4 ++++ test/files/run/exceptions-2.scala | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) (limited to 'test/files') 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 } } -- cgit v1.2.3