Switch labels (null again), some tweaking

Brian Goetz brian.goetz at oracle.com
Wed Apr 28 00:46:13 UTC 2021


> - for a switch where you can enumerate all the values enums, sealed 
> type (boolean should be in that category too IMO, but we did not agree 
> on that), if you list all the possible cases, a total case is not 
> required.

In fact, when you can enumerate the values/types, it is better to _not_ 
have a catch-all.  Because then you get better type checking when you 
only think you listed them all, or a new one is added later.


More information about the amber-spec-experts mailing list