From 4d9354ae14d581fb548d1e926fbf3adb7d3bf615 Mon Sep 17 00:00:00 2001 From: Burak Emir Date: Tue, 4 Sep 2007 17:55:46 +0000 Subject: fixed #11 --- test/files/run/patmatnew.scala | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'test/files/run') diff --git a/test/files/run/patmatnew.scala b/test/files/run/patmatnew.scala index c8ca9c19cb..b05da464a5 100644 --- a/test/files/run/patmatnew.scala +++ b/test/files/run/patmatnew.scala @@ -43,6 +43,7 @@ object Test extends TestConsoleMain { Bug1094, ClassDefInGuard, Ticket2, + Ticket11, Ticket37 ) @@ -589,6 +590,36 @@ object Test extends TestConsoleMain { }) }} +// #11 + + class MyException1 extends Exception + + // Commenting out the following line and uncommenting the second line + // will cause the test to succeed. + trait SpecialException extends MyException1 + // trait SpecialException + + class MyException2 extends MyException1 with SpecialException + + object Ticket11 extends TestCase("#11") { + override def runTest { + Array[Throwable](new Exception("abc"), + new MyException1, + new MyException2).foreach { e => + try { + throw e + } catch { + case e : SpecialException => { + assume(e.isInstanceOf[SpecialException]) + } + case e => { + assume(e.isInstanceOf[Throwable]) + } + } + } + } + } + // #37 object Ticket37 extends TestCase("#37") { -- cgit v1.2.3