This will not solve the problem of Maurizio for sub-patterns but i like it.

I agree it doesn't *solve* the problem, but it helps somewhat.

We don't have to later transform the warning to an error, keeping it as a warning can be annoying enough to force people to change their code (or ALT-ENTER + CTRL+1 ont it).

Yes, we can make this decision later.



    Legacy switches are those whose operand type is one of the
    "classic" types and all labels are constant labels or "default".

    For a switch that is deliberately non-exhaustive, all the user has
    to do to capture this (and shut up the compiler) is:

        default: break;


"default:" should be enough no ?

Yes, probably.



    which is not very intrusive, and arguably makes the code more
    readable anyway.  Users will see a speed bump when upgrading to
    pattern switches (clippy will tell them "I see you're writing a
    pattern switch, don't forget to end it with default:break") which
    presumably they will quickly internalize.

    (How's that for teaching an old dog new tricks?)



I think we should tackle "default" not being at the end the same way.


I'd like that; pushing total patterns to the end is pretty helpful. We tried that once, and ran into trouble, though; there were cases we couldn't completely express with that IIRC.  With the latest formulation of `case null, default`, I think the trouble we ran into before goes away, but we might have new trouble doing so.

Reply via email to