diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2007-11-20 11:11:52 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2007-11-20 11:11:52 +0000 |
commit | e117099d3ddcdfe87b5602887570087b9a443614 (patch) | |
tree | 2802f502c9e22449dfb8711a5f3313532d338a30 /test/files | |
parent | a98fe88f2e306061201086ac4c0f6d1baa48b65a (diff) | |
download | scala-e117099d3ddcdfe87b5602887570087b9a443614.tar.gz scala-e117099d3ddcdfe87b5602887570087b9a443614.tar.bz2 scala-e117099d3ddcdfe87b5602887570087b9a443614.zip |
Fixed ticket #244.
Diffstat (limited to 'test/files')
-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); } } |