Skip to content

Commit 902e332

Browse files
Backport "Add a test case, proving i15661 is fixed" to LTS (#20829)
Backports #19432 to the LTS branch. PR submitted by the release tooling. [skip ci]
2 parents 372e437 + 81e02c6 commit 902e332

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)