I have one vector instance and I’m exporting swf with Flash Player 10/10.1.
I want initialise it with a parametric type. I tried as follow:
var someType:Class = MyCustomClass;
var v:Vector.<someType> = new Vector.<someType>();
But it doesn’t work!!
There is a way to do this?
I hope question is clear 🙂
Thanks in advance!
someTypeis the instance of the class type; whereas Vector is a container of that type.This should be:
Otherwise, I’ve noticed Haxe would compile this as:
Flash polymorphism is lacking, if you had class A and class B, and attempted to push them to a vector of type Class you would receive an error:
Example
Error: