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 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/valhalla-spec-experts/attachments/20190415/863dd545/attachment.html>


More information about the valhalla-spec-experts mailing list