"Model 2" prototype status
smarter3 at gmail.com
Mon Aug 3 19:09:56 UTC 2015
On Monday 03 August 2015 18:45:18 Stephen Colebourne wrote:
> On 3 August 2015 at 16:00, Brian Goetz <brian.goetz at oracle.com> wrote:
> > Don't forget nullability is just an example here of the category of things
> > that "classical" generics allow based on the assumption that type
> > variables
> > only quantify over reference types.
> While true, I think it is fair to say it is likely to be the key one
> that affects developers. Relatively few would call synchronized on an
> arbitrary T, or wait(), or notify(). Whereas, assuming that T could be
> null and setting it to null is a pretty common assumption (whether for
> good or bad). That is why nulls will be an area I'll be watching
> closely as the prototype develops, to attempt to tease out if the
> right choice/balance/tradeoff is being made.
Right now, the prototype allows you to write "T.default" to get a value of
type T which is null for references and 0 for value types.
More information about the valhalla-dev