Parameterised types' class_path in haxe compiler.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Parameterised types' class_path in haxe compiler.

Gamehaxe
Hi,

When a class or function is parameterised on type T, instances
of that variable have a type of class_name.T or function_name.T.
Is there any way to detect the fact that the variable
is parameterised without tracking the current class and current
fucntion?

Hugh

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Parameterised types' class_path in haxe compiler.

Nicolas Cannasse
Hugh Sanderson a écrit :
> Hi,
>
> When a class or function is parameterised on type T, instances
> of that variable have a type of class_name.T or function_name.T.
> Is there any way to detect the fact that the variable
> is parameterised without tracking the current class and current
> fucntion?

Yes, it's .cl_kind field should be set to KTypeParameter.

Best,
Nicolas


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Parameterised types' class_path in haxe compiler.

Gamehaxe
Thanks a lot, that should tidy things up a bit.

Hugh

> Hugh Sanderson a écrit :
>> Hi,
>>  When a class or function is parameterised on type T, instances
>> of that variable have a type of class_name.T or function_name.T.
>> Is there any way to detect the fact that the variable
>> is parameterised without tracking the current class and current
>> fucntion?
>
> Yes, it's .cl_kind field should be set to KTypeParameter.
>
> Best,
> Nicolas
>
>



--
haXe - an open source web programming language
http://haxe.org