[pattern-switch] Opting into totality

forax at univ-mlv.fr forax at univ-mlv.fr
Mon Sep 7 08:20:48 UTC 2020


----- Mail original -----
> De: "Brian Goetz" <brian.goetz at oracle.com>
> À: "daniel smith" <daniel.smith at oracle.com>
> Cc: "Remi Forax" <forax at univ-mlv.fr>, "amber-spec-experts" <amber-spec-experts at openjdk.java.net>
> Envoyé: Dimanche 6 Septembre 2020 18:53:36
> Objet: Re: [pattern-switch] Opting into totality

>> So I appreciate the brainstorming, but personally don't really see a problem
>> that needs solving here. (Other than the syntax bikeshed.)
> 
> Agreed, it was worth poking around the corners with a flashlight, but
> the exploration brought me back to this point too.  (If we even need it
> at all.)
> 
> Some of the motivation for this exercise has been that some people feel
> uncomfortable at inferred totality.  But, there's a good chance that
> this discomfort is temporary -- this happens every time any sort of
> implicitness is added to the language.   (People freaked out about var
> at first too.)

at least for me, frame it like that doesn't help,
the issue is accidental totality (or accidental non-totality) in a switch statement no problem with neither inferred totality nor with the switch expression.

and to refine the question of this thread, i don't think we need to opt in to full totality, what is needed it an opt in to optimistic totality, adding a default or a case var x is enough otherwise.

Rémi








More information about the amber-spec-experts mailing list