Closed smilingleo closed 8 years ago
Wow - I'm surprised that works. I thought that the only way to get the semi-reified type was the way I did it. I'll need to test this in some edge cases.
This does not work. Try this:
Any<List<String>> anyList1 = Any.type();
Any<List<String>> anyList2 = new Any<List<String>>(){};
System.out.println(anyList1.getRawType());
System.out.println(anyList2.getRawType());
There's no workaround that I know of.
Oops, poor Java type system. Let me see if there I can find a workaround.
It's erasure. A 1000 deaths for those who decided erasure was OK.
no workaround, :(
There's a special place in Hell for erasure :(
instead of
new AnyType<MyType>(){}
everywhere, just useAny.type()