Skip to content

Commit

Permalink
Add a test case, proving i15661 is fixed (#19432)
Browse files Browse the repository at this point in the history
Closes #15661

This is broken in 3.2.0-RC1, but fixed in main as well as 3.3.0-RC1.
  • Loading branch information
nicolasstucki authored Jan 15, 2024
2 parents 994ceac + afb4825 commit 31f837e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/warn/i15661.scala
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 31f837e

Please # to comment.