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.


Reply via email to