3 ms·
I think you should be very careful with statements like that. The Valhalla work adds a mechanism by which generic types can be reified, but reference types in J
by aardvark179 10y ago
I think you should be very careful with statements like that. The Valhalla work adds a mechanism by which generic types can be reified, but reference types in Java are not proposed to be reified as that would cause big interoperability problems with existing code. However the mechanism introduced for reifying value generics could be used by other JVM languages to provide reified reference generic types.
So HashMap<MyRefClass> will always remain the same class as HashMap<Object> when created in Java code, but might not be the same in another JVM language, and HashMap<MyValueType> will never be the same class as HashMap<Object>.
- pjmlp 10y agoTrue, but nothing prevents them to have an ImprovedHashMap<any MyRefClass>.