Sure - but this logic is only applied to switch expression featuring enums AFAIK - switch statements with enums are non-exhaustive (and I think that will have to stay that way).

Slight correction: switch statements on enum selectors *that don't use patterns or guards or case null* are non-exhaustive.  IOW, the current carve-out for non-exhaustiveness is "if you don't use any of the new switch features."

As to "will have to stay that way", I guess it depends on timeframe.  I can see a path of gradually increasing warnings ("totalize that switch with a default clause, dude") turning to error in a decade or so?

Reply via email to