Question about improvement on reified generics

Marcus Manning iconsize at gmail.com
Fri Oct 27 18:41:21 UTC 2017


I'am not the option of "type erasure is bad", it is indeed very mastered 
in Haskell and D. I'am not an expert of how the jvm write out generic 
classes.  My problem is that List<Integer> and List<Double> are written 
to the same class List in (bytecode?), but they should not. Why cannot 
be List<Double> or List<Integer> written to different classes in 
bytecode with names List#Integer and List#Double?

Best Regards,

Marcus.

On 10/27/2017 06:25 PM, Brian Goetz wrote:
> Thinking of Valhalla as being about "reification" is likely to take 
> you down the wrong path.  We don't view erasure as a "bug" that needs 
> to be "fixed" (despite how superficially attractive this sort of 
> thinking is.)
>
> The most likely place where we land is that value instantiations are 
> specialized (so that the layout may be specialized), and reference 
> instantiations will remain erased.  (All references have the same 
> layout, so layout specialization is not needed.)
>
>
> On 10/27/2017 11:29 AM, Marcus Manning wrote:
>> Hello Valhalla-Dev,
>>
>> I have a question to the the improvement of reified generics in java. 
>> I read about it by [1]
>> If I understand it correctly, class<value type> will be reified, but 
>> not class<reference type>, right? But then, on page 31 of [1] 
>> something like a reified String is captured and String is a reference 
>> type? After all, will class<reference type> become a reified type?
>>
>> Best regards,
>>
>> Marcus
>>
>



More information about the valhalla-dev mailing list