3 ms·
> Type erasure is certainly a part of the JVM No, it is not. Most JVM languages (except Ceylon, I think) choose to erase generics, as that's the right thing to
by pron 8y ago
> Type erasure is certainly a part of the JVM
No, it is not. Most JVM languages (except Ceylon, I think) choose to erase generics, as that's the right thing to do if you want good polyglot interop.
- mruts 8y agoNo, I mean that the JVM itself doesn’t have opcodes for storing generics type info. Hence why it was done for backward compatability, they didn’t need to add or change instructions.
- pron 8y agoThat's incorrect. You could specialize classes on the fly (and the opcodes for all reference types are the same, anyway). It's just that it's a bad idea to reify generics of reference (and so subtypable) types. You gain little and lose much.
- mruts 8y agoOk I looked it up. You’re right. Kudos