User model: ref as default, vs universal generics
Brian Goetz
brian.goetz at oracle.com
Wed May 4 14:27:52 UTC 2022
Just to record a constraint: there's somewhat of a conflict between the
idea of "make ref the default", as Kevin advocated, and universal
generics, which we need to keep in mind as we stack the whole tower.
If a B3 class gives us Foo and Foo.val, then Map::get (currently) has no
way to declare its return value as "ref T". The plan of record has been:
V.ref get(K key)
but if V.ref is not denotable, we have a problem. That means we can't
*just* have Foo and Foo.val; we need at least to be able to say T.ref
for type variables, if not Foo.ref for all B3 classes.
If we can manage to use T!, then this is an obvious application for T?,
but this approach brings new questions.
More information about the valhalla-spec-observers
mailing list