Main.hx 331 B

1234567891011121314151617181920212223
  1. @:generic
  2. class A<T> {
  3. var items:Array<T>;
  4. public function new() {
  5. items = [];
  6. }
  7. inline public function get(_index:Int) : T {
  8. return items[_index];
  9. }
  10. }
  11. class Test {
  12. var a: A<Int>;
  13. function new() {
  14. }
  15. static function main() {
  16. trace("Haxe is great!");
  17. a.
  18. }
  19. }