Closed
Description
Minimized code
scala> sealed trait T ; case class C(x: Int) extends T
// defined trait T
// defined case class C
scala> (C(42): T) match { case C(42) => }
1 |(C(42): T) match { case C(42) => }
| ^^^^^^^^
| match may not be exhaustive.
|
| It would fail on pattern case: C(_)
scala> (C(42): T) match { case C(_) => }
scala> (C(42): T) match { case C(x) => }
scala> sealed trait T ; case class C(x: Int*) extends T
// defined trait T
// defined case class C
scala> (C(42): T) match { case C(42) => }
1 |(C(42): T) match { case C(42) => }
| ^^^^^^^^
| match may not be exhaustive.
|
| It would fail on pattern case: C(_, _: _*), C(_, _, _: _*), C()
scala> (C(42): T) match { case C(xs: _*) => }
1 |(C(42): T) match { case C(xs: _*) => }
| ^^^^^^^^
| match may not be exhaustive.
|
| It would fail on pattern case: C(_: _*)
scala> (C(42): T) match { case C(_: _*) => }
scala>
Output
scala> (C(42): T) match { case C(xs: _*) => }
1 |(C(42): T) match { case C(xs: _*) => }
| ^^^^^^^^
| match may not be exhaustive.
|
| It would fail on pattern case: C(_: _*)
Expectation
Expect case C(xs: _*)
is as exhaustive as case C(_: _*)
.
Observed at #8715