diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/structural.check | 1 | ||||
-rw-r--r-- | test/files/run/structural.scala | 22 |
2 files changed, 23 insertions, 0 deletions
diff --git a/test/files/run/structural.check b/test/files/run/structural.check index 34d31ada59..52292fcb36 100644 --- a/test/files/run/structural.check +++ b/test/files/run/structural.check @@ -32,3 +32,4 @@ 3 4 5 +caught diff --git a/test/files/run/structural.scala b/test/files/run/structural.scala index 6ced0e569a..d6b2b3d09f 100644 --- a/test/files/run/structural.scala +++ b/test/files/run/structural.scala @@ -150,7 +150,29 @@ object test2 { x5.f() } +object test3 { + + case class Exc extends Exception + + object Rec { + def f = throw Exc() + } + + def m(r: { def f: Nothing }) = + try { + r.f + } + catch { + case e: Exc => println("caught") + case e => println(e) + } + + m(Rec) + +} + object Test extends Application { test1 test2 + test3 } |