hg: valhalla/valhalla/langtools: Add experimental support for generic class literals

Paul Benedict pbenedict at apache.org
Mon Aug 18 14:29:53 UTC 2014


Okay, I missed that fine point. It's only reifiable if the actual type is a
primitive.


Cheers,
Paul


On Mon, Aug 18, 2014 at 9:24 AM, Remi Forax <forax at univ-mlv.fr> wrote:

>
> On 08/18/2014 04:07 PM, Maurizio Cimadamore wrote:
>
>>
>> On 18/08/14 14:51, Paul Benedict wrote:
>>
>>> Just asking so I can understand.... are specialized classes fully
>>> reifiable?
>>>
>> Yeah - stuff like Box<int> is considered to be fully reified, as the
>> specializer will turn it into a specialized Box${T=int} version where all
>> references to the type-variables have been replaced with their 'I'
>> counterparts. This means you can lift all restrictions that apply to
>> reified types, such as no array creation, no instance of, unchecked cast
>> only, no class literals.
>>
>> Maurizio
>>
>
> yes, specialized class are fully reified if arguments are primitive types,
> also a specializable type Box<T> as in <any T> Box<T> is not reified but
> may be reified if T is a primitive.
>
> so instanceof Box<int> is ok while <any T> instanceof Box<T> will generate
> a warning and <T extends Object> instanceof Box<T> generate an error.
>
>
>>>
>>> Cheers,
>>> Paul
>>>
>>
> cheers,
> Rémi
>
>


More information about the valhalla-dev mailing list