CFE error message for non-exhaustion of promoted-type-variable is misleading #54652
Labels
area-front-end
Use area-front-end for front end / CFE / kernel format related issues.
cfe-messages
Poor/undesirable messaging in errors/warnings emitted by the CFE.
If I do:
I get an error (correctly) saying that the switch statement is not exhaustive, because the type
T&Sealed
is always-exhaust.The message is:
The problem here is that the type that needs to be exhausted is
Sealed
, notT
.The analyzer, in comparison, reports:
That's technically correct, but arguably leaking the internal intersection type.
What the user knows it that they promoted to
Sealed
, so they expect that they are working onSealed
.Still, it's better than
T
.(Found while testing extension types, but also applies to plain classes.)
The text was updated successfully, but these errors were encountered: