I have an interface that contains an array (or list) of T and some metadata. If I write the simplest implementation of the interface, I get a compile error on the emptyArray(): “Cannot use T as a reified type parameter. Use a class instead.” However, if I change both the interface and the implementation to a list, I have no
Tag: reification
What are Reified Generics? How do they solve Type Erasure problems and why can’t they be added without major changes?
I’ve read Neal Gafter’s blog on the subject and am still unclear on a number of points. Why is it not possible to create implementations of the Collections API that preserve type information given the current state of Java, the JVM and existing collections API? Couldn’t these replace the existing implementations in a future version of Java in a way