1

As you all know, Vector support type checking by added Type parameter.

var v:Vector.<String> = new Vector.<String>();

I wonder if I am able to create a custom class that have Type parameter, something like this

var myClassInstance: MyClassDefinition.<String>;

Thank you.

Harry.

Harry Ninh
  • 16,288
  • 5
  • 60
  • 54
  • possible duplicate of [How would you implement generics like Vector.?](http://stackoverflow.com/questions/4071536/how-would-you-implement-generics-like-vector-t) – Kris Welsh Jul 05 '13 at 11:57

1 Answers1

2

ActionScript doesn’t (yet) support generics. Vector is a special case with support hard-coded into the compiler.

See also: Why doesn't ActionScript have “generics”?

Community
  • 1
  • 1
Daniel Cassidy
  • 24,676
  • 5
  • 41
  • 54