Skip to content

Commit 31f837e

Browse files
Add a test case, proving i15661 is fixed (#19432)
Closes #15661 This is broken in 3.2.0-RC1, but fixed in main as well as 3.3.0-RC1.
2 parents 994ceac + afb4825 commit 31f837e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/warn/i15661.scala

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
case class Composite[T](l: List[T], v: T)
2+
3+
def m(composite: Composite[?]): Unit =
4+
composite match {
5+
case Composite(l: List[Int], v: Int) => println(v) // warn: type test for List[Int] cannot be checked at runtime
6+
case _ => println("This is not Int") // was: warn: Unreachable case except for null
7+
}

0 commit comments

Comments
 (0)