Constraints in method parameters

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

Constraints in method parameters

Rudolfs Pukitis
Hi,

I'm new to HaXe.
First of all I came from as3 and generic support in HaXe seems great for
me.But then I get stuck and seems that constraints in method parameters
is not supported yet -> http://haxe.org/com/features , is it still on
feature list?
What I want to do is something like in Java ->
     public<T extends Component> T getComponent(Entity entity, Class<T>
componentType) { ........ }
but in haXe ->
     public function getComponent<T:Component>(e:Entity, T) { ........ }
<- throws error : This notation is not allowed because it can't be checked .

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

Haxe 2.08 and Neko 1.8.2

Philippe Riou
Hi all,

I don't exactly know what you did, but since I upgraded to the new Haxe
and Neko, file loading and parsing improved by 200% on iPhone with NME.
That is just amazing and solved my biggest issue so far.

Nice work!

Phil.

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

Re: Constraints in method parameters

Nicolas Cannasse
In reply to this post by Rudolfs Pukitis
Le 18/10/2011 22:45, Rudolfs Pukitis a écrit :
> Hi,
>
> I'm new to HaXe.
> First of all I came from as3 and generic support in HaXe seems great for
> me.But then I get stuck and seems that constraints in method parameters
> is not supported yet -> http://haxe.org/com/features , is it still on
> feature list?

Yes it's planned here :
http://code.google.com/p/haxe/issues/detail?id=248
No specific deadline so far.

Best,
Nicolas

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