Expression switch exception naming

Remi Forax forax at
Sat Mar 31 12:14:26 UTC 2018

An enum class is always sealed, there is a fixed number of constants values, and there is also a fixed number of subtypes,
otherwise values() is not correctly implemented.


----- Mail original -----
> De: "Doug Lea" <dl at>
> À: "Brian Goetz" <brian.goetz at>
> Cc: "amber-spec-experts" <amber-spec-experts at>
> Envoyé: Samedi 31 Mars 2018 13:56:44
> Objet: Re: Expression switch exception naming

> On Fri, March 30, 2018 1:48 pm, Brian Goetz wrote:
>> So an alternative here is to tweak the language so that the "conclude
>> exhaustiveness if all enum constants are present" behavior should be
>> reserved for the cases where the switch and the enum are in the same
>> module?
> I might have missed discussion of this, but has anyone considered
> the alternative of finally allowing "final" on an enum class? In
> this case, several sets of simpler alternatives would be possible.
> -Doug

More information about the amber-spec-experts mailing list