Closed
Description
This example:
sealed trait Parent
final case class Leaf[A, B >: A](a: A, b: B) extends Parent
def run(x: Parent): Unit = x match {
case Leaf(a, b) =>
}
Leads to the following spurious warning:
-- [E029] Pattern Match Exhaustivity Warning:
6 |def run(x: Parent): Unit = x match {
| ^
| match may not be exhaustive.
|
| It would fail on pattern case: Leaf(_, _)
|
| longer explanation available when compiling with `-explain`
1 warning found
I suspect the issue to be different from #15522, since it is present on both main
and 3.1.2
.