> De: "Brian Goetz" <brian.go...@oracle.com> > À: "Remi Forax" <fo...@univ-mlv.fr> > Cc: "Maurizio Cimadamore" <maurizio.cimadam...@oracle.com>, > "valhalla-spec-experts" <valhalla-spec-experts@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