diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/exceptions-2.check | 2 | ||||
-rw-r--r-- | test/files/run/exceptions-2.scala | 16 |
2 files changed, 18 insertions, 0 deletions
diff --git a/test/files/run/exceptions-2.check b/test/files/run/exceptions-2.check index 139b4c401f..6f6af38e29 100644 --- a/test/files/run/exceptions-2.check +++ b/test/files/run/exceptions-2.check @@ -48,3 +48,5 @@ Normal execution... inner finally finally inside finally Outer finally +Throw in catch and finally: +ABC diff --git a/test/files/run/exceptions-2.scala b/test/files/run/exceptions-2.scala index 0805ffe295..1c6245b891 100644 --- a/test/files/run/exceptions-2.scala +++ b/test/files/run/exceptions-2.scala @@ -235,6 +235,19 @@ object Test { } } + def tryThrowFinally: Unit = { + try { + print("A") + throw new Exception + } catch { + case e : Exception => + print("B") + throw e + } finally { + println("C") + } + } + def execute(f: => Unit) = try { f; } catch { @@ -294,5 +307,8 @@ object Test { Console.println("Return inside body and return in finally inside finally:"); execute(returnInBodyAndInFinally2); + + Console.println("Throw in catch and finally:"); + execute(tryThrowFinally); } } |