Skip to content

Commit 72ab3af

Browse files
committed
Add additional test
1 parent 6b26186 commit 72ab3af

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

tests/run/i5067b.check

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
match error
2+
match error nested
3+
not implemented error

tests/run/i5067b.scala

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
object Test {
2+
def main(args: Array[String]): Unit = {
3+
class B[T] {}
4+
object B {
5+
def unapply[T](x: Any): Option[B[T]] = None
6+
}
7+
try {
8+
val B(_) = null
9+
} catch {
10+
case e: MatchError => println("match error")
11+
}
12+
13+
null match {
14+
case null =>
15+
try {
16+
null match {
17+
case Some(_) => ()
18+
}
19+
} catch {
20+
case e: MatchError => println("match error nested")
21+
}
22+
}
23+
24+
try {
25+
??? match {
26+
case (_, _) => ()
27+
case _ => ()
28+
}
29+
} catch {
30+
case e: NotImplementedError => println("not implemented error")
31+
}
32+
}
33+
}

0 commit comments

Comments
 (0)