Reputation: 12121
Is it possible to use the Type.<T> syntax with user defined classes? For example, let's say I want to create a List class, but I want the user to use it like this:
var myList:List.<String> = new List.<String>;
or is this syntax exclusively evailable to the Vector class only?
Thanks!
Upvotes: 1
Views: 128
Reputation: 15623
Have a look at Haxe ... you can compile Haxe to swfs as well, and unlike AS3, it supports generics ...
edit: Haxe can target flash10 ... unlike ActionScript 3, Haxe even can use alchemy opcodes: http://haxe.org/api/flash9/memory ... plus the generated bytecode is faster ... actually Haxe is a much better tool to leverage the potentials of the AVM2
Upvotes: 0
Reputation: 4468
At the moment it can only be used by the Vector class. Any other attempted use of the syntax will throw a compiler error.
Upvotes: 4