RefObject and ValObject
Brian Goetz
brian.goetz at oracle.com
Mon Apr 15 20:25:59 UTC 2019
That’s right, as we think that will be the best default. Obviously in some cases users will want to re-bound to <T extends RefObject>.
(For existing code; this comes with compatibility concerns, which we can handle in various ways. The standard trick to change a bound without changing erasure is to bound at Object&X; this works when X is an interface but currently would be unhappy if X is a class. But this could be adjusted.)
> On Apr 15, 2019, at 4:23 PM, Maurizio Cimadamore <maurizio.cimadamore at oracle.com> wrote:
>
> Maybe (Remi correct me if I'm wrong), the problem Remi was referring to is that we also have existing generic declarations like <T extends Object> which, in the new world, will mean either VALUE or REFERENCE. I think this is a consequence of the choice (1) I described in my email - e.g. reinterpret Object in type position as TOP_TYPE.
>
> Maurizio
>
> On 15/04/2019 19:00, Brian Goetz wrote:
>>>
>>> It's not a minor change, and all code that uses a type parameter that have Object as bound will become ambiguous.
>>
>> I don’t think so. You can’t say
>>
>> new T()
>>
>> when T is bounded at Object (or anything, for that matter.).
>>
>> What ambiguity are you afraid of here?
>>
>>
More information about the valhalla-spec-observers
mailing list