summaryrefslogtreecommitdiff
path: root/test/files/run/patmatnew.scala
diff options
context:
space:
mode:
authorBurak Emir <emir@epfl.ch>2007-09-04 17:55:46 +0000
committerBurak Emir <emir@epfl.ch>2007-09-04 17:55:46 +0000
commit4d9354ae14d581fb548d1e926fbf3adb7d3bf615 (patch)
treee49c4951509819268d7460d814a5641f93ce6168 /test/files/run/patmatnew.scala
parent92629629ab76311540303f6644f5f336a6fe81d3 (diff)
downloadscala-4d9354ae14d581fb548d1e926fbf3adb7d3bf615.tar.gz
scala-4d9354ae14d581fb548d1e926fbf3adb7d3bf615.tar.bz2
scala-4d9354ae14d581fb548d1e926fbf3adb7d3bf615.zip
fixed #11
Diffstat (limited to 'test/files/run/patmatnew.scala')
-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") {