Main.hx 256 B

123456789101112131415161718
  1. class Test {
  2. public function new() {}
  3. }
  4. class Main {
  5. public static function main() {
  6. new Generic<Test>();
  7. }
  8. }
  9. @:generic
  10. class Generic<T:({function new():Void;})> {
  11. var t:T;
  12. public function new() {
  13. t = new T();
  14. }
  15. }