[External] : Re: Switch labels (null again), some tweaking

Brian Goetz brian.goetz at oracle.com
Fri Apr 23 20:38:41 UTC 2021



On 4/23/2021 4:25 PM, Remi Forax wrote:
>> Bottom line:  Trust the users to choose how
>> explicit to be with nulls.  More importantly,
>> trust them with compositional notations.
> That's a solution, we do nothing and trust users.
> The other solution is to force users to explicit say that the pattern is total, by example by asking to use 'var o' instead of 'Object o',
> but we already discuss that and only me and Tagir were agreeing that it is a good idea.

Yes, this is what I meant by "move the distinction around."  We could 
say that `var x` and `Object x` are different patterns; this is a sharp 
edge in one place (blows up the notion that `var` is just type 
inference.)  We could say that `default` and `Object x` are different 
patterns (which is what I'm suggesting), which puts the sharp edge 
somewhere else -- it means that people's notion of totality is polluted 
by historical chance.  We could have different patterns for Object! and 
Object?, which is appealing in a "say what you mean" way, but which 
forces users to think about a corner case all the time.

Reasonable people can differ about which of these (or other) approach is 
best for Java, but it is not reasonable to believe that we can hide this 
distinction.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/amber-spec-experts/attachments/20210423/e8a03d0d/attachment-0001.htm>


More information about the amber-spec-experts mailing list