Skip to content

Commit 147bdae

Browse files
committed
Test for regression
1 parent 434c0ed commit 147bdae

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/run/enum-in-trait.scala

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
trait TR {
2+
enum X:
3+
case A
4+
case B(n: Int)
5+
def bad(x: X): Unit = x match {
6+
case X.A => ()
7+
case X.B(n) => println(n)
8+
}
9+
}
10+
class C extends TR {
11+
def caller(): Unit = bad(X.A)
12+
}
13+
object Test {
14+
def main(args: Array[String]): Unit =
15+
val c = new C()
16+
c.caller()
17+
}

0 commit comments

Comments
 (0)