Java introduced type erasure with generics in Java 5 so they would work on old versions of Java. It was a tradeoff for compatibility. We've since lost that compatibility  --bytecode can be run on later versions of the JVM but not earlier ones. This looks like the worse possible choice: we've lost type information and we still can't run bytecode compiled for newer versions of the JVM on older versions. What happened?
Specifically I'm asking if there are any technical reasons why type erasure couldn't be removed in the next version of the JVM (assuming, like previous releases, its bytecode won't be able to run on the last version anyway).
: Type erasure could be backported in a manner similar to retrolambda for those who really like it.
Edit: I think the discussion of the definition of backwards vs. forwards compatibility is obscuring the question.
To some extent erasure will be removed in the future with project valhalla to enable specialized implementations for value types.
Or to put it more accurately, type erasure really means the absence of type specialization for generics, and valhalla will introduce specialization over primitives.
Specifically I'm asking if there are any technical reasons why type erasure couldn't be removed in the next version of the JVM
Performance. You don't have to generate specialized code for all combinations of generic types, instances or generated classes don't have to carry type tags, polymorphic inline caches and runtime type checks (compiler-generated
instanceof checks) stay simple and we still get most of the type-safety through compile-time checks.
Of course there are also plenty of downsides, but the tradeoff has already been made, and the question what would motivate the JVM devs to change that tradeoff.
And it might also be a compatibility thing, there could be code that performs unchecked casts to abuse generic collections by relying on type erasure that would break if the type constraints were enforced.