----- Original Message -----
> From: "Tagir Valeev" <[email protected]>
> To: "Brian Goetz" <[email protected]>
> Cc: "amber-spec-experts" <[email protected]>
> Sent: Monday, September 19, 2022 9:22:34 AM
> Subject: Re: [enhanced-switches] My experience of converting old switches to
> new ones
> Hello!
>
>> > We need total switch statements.
>>
>>
>> Is this different from the "default impossible" above?
>
> Yes. I mean, currently we cannot have exhaustiveness checks on enum
> switch statements having a compilation error when a new enum constant
> is added. We have this for switch expressions and for sealed classes,
> but not for switch statements over enums.
enum Foo { A, B }
switch(foo) {
case null -> throw null;
case A -> ...
case B -> ...
}
is exhaustive.
>
> With best regards,
> Tagir Valeev.
Rémi