Open
Description
Compiler version
3.3.1
Minimized code
enum Eq[A, B]:
case Refl[A]() extends Eq[A, A]
enum T[A]:
case S(witness: Eq[A, String])
case I(witness: Eq[A, Int])
def partial(tagged: T[Int]) : Int =
tagged match
case T.I(Eq.Refl()) => 0
Output
match may not be exhaustive.
It would fail on pattern case: T.S(_)
Expectation
This warning is incorrect: it's impossible to produce an Eq[A, B]
where A
and B
are distinct, so a T[Int]
must be a T.I
: a T.S
would need an Eq[Int, String]
, which is impossible.