Skip to content

Commit ccfba35

Browse files
authored
Merge pull request scala#5986 from retronym/ticket/9146
Test case for already-fixed pattern matcher bug
2 parents cc7ba86 + 1c7bb21 commit ccfba35

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

test/files/run/t9146.scala

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
trait A {
2+
val value: String
3+
}
4+
5+
trait B {
6+
val as: List[A]
7+
}
8+
9+
case class C(value: String) extends A
10+
11+
object Test {
12+
object test extends B {
13+
val as = List(
14+
new C("one") {},
15+
new C("two") {}
16+
)
17+
18+
def method = as match {
19+
case List(C("one"), _) => 1
20+
case _ => 42
21+
}
22+
}
23+
def main(args: Array[String]): Unit = {
24+
assert(test.method == 1)
25+
}
26+
}

0 commit comments

Comments
 (0)