diff --git a/tests/warn/i15661.scala b/tests/warn/i15661.scala new file mode 100644 index 000000000000..f641222efe4b --- /dev/null +++ b/tests/warn/i15661.scala @@ -0,0 +1,7 @@ +case class Composite[T](l: List[T], v: T) + +def m(composite: Composite[?]): Unit = + composite match { + case Composite(l: List[Int], v: Int) => println(v) // warn: type test for List[Int] cannot be checked at runtime + case _ => println("This is not Int") // was: warn: Unreachable case except for null + }