hg: valhalla/valhalla/langtools: Add experimental support for generic class literals
Remi Forax
forax at univ-mlv.fr
Mon Aug 18 14:24:36 UTC 2014
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