summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/files/run/patmatnew.scala31
1 files changed, 31 insertions, 0 deletions
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") {