IdentityObject and InlineObject

forax at forax at
Sat Dec 7 19:48:04 UTC 2019

> De: "John Rose" <john.r.rose at>
> À: "Brian Goetz" <brian.goetz at>
> Cc: "Remi Forax" <forax at>, "valhalla-spec-experts"
> <valhalla-spec-experts at>
> Envoyé: Samedi 7 Décembre 2019 02:31:48
> Objet: Re: IdentityObject and InlineObject

> On Dec 6, 2019, at 2:28 PM, Brian Goetz < [ mailto:brian.goetz at |
> brian.goetz at ] > wrote:

>> public class IdentityHashMap<E extends Object&IdentityObject> { ... }

> (There’s your erasure trick, Remi, used against you. Brian has no mercy!)

No, it's actually a good question ! 

First, it only works for one of the 3 examples I have given. 
Then i've found that using this trick useful on generic static method and far less useful on generic classes because those can have subclasses. 

By example, in the case of IdentityHashMap, you only delay the issue because any classes that inherits from IdentityHashMap<IdentityObject, ...> (and IdentityHashMap with the (first) type argument specified) is not binary backward compatible. 


More information about the valhalla-spec-observers mailing list