RefObject and ValObject
forax at univ-mlv.fr
forax at univ-mlv.fr
Mon Apr 15 20:36:14 UTC 2019
> De: "Brian Goetz" <brian.goetz at oracle.com>
> À: "Remi Forax" <forax at univ-mlv.fr>
> Cc: "Maurizio Cimadamore" <maurizio.cimadamore at oracle.com>,
> "valhalla-spec-experts" <valhalla-spec-experts at openjdk.java.net>
> Envoyé: Lundi 15 Avril 2019 20:00:52
> Objet: Re: RefObject and ValObject
>> 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?
1) any codes that has inference
var list = List.of(new Foo(), new Bar());
will be inferred as List<RefObject> instead of List<Object>, so calling a method that takes a List<Object> will not compile anymore.
2) any code that consider Object as special class may stop working, dynamic proxies that have a special case for Object, any code that reflect recursively on the hierarchy to find all the methods, any code that remove getClass() from the getter list, etc.
Rémi
More information about the valhalla-spec-observers
mailing list