From afb4825a06b35870ab97eceb0f35927218af08db Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Fri, 12 Jan 2024 15:20:07 +0000 Subject: [PATCH] Add a test case, proving i15661 is fixed --- tests/warn/i15661.scala | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 tests/warn/i15661.scala 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 + }