Skip to content

Commit

Permalink
Add a test case, proving i15661 is fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
dwijnand committed Jan 12, 2024
1 parent b2ba6dc commit afb4825
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 afb4825

Please # to comment.