소스 검색

[tests] Add test for #5458 (#11933)

Rudy Ges 8 달 전
부모
커밋
5fef762a78
2개의 변경된 파일18개의 추가작업 그리고 0개의 파일을 삭제
  1. 17 0
      tests/misc/projects/Issue5458/Main.hx
  2. 1 0
      tests/misc/projects/Issue5458/compile.hxml

+ 17 - 0
tests/misc/projects/Issue5458/Main.hx

@@ -0,0 +1,17 @@
+class Main {
+  static function main() {
+    foo({strings: []});
+  }
+
+  static function foo(data:{strings:Array<String>}) {
+    var ref:References<Main> = data.strings;
+    trace(ref);
+  }
+}
+
+@:forward
+abstract References<M:Main>(Array<Int>) from Array<Int> {
+    @:from
+    public static inline function fromStrings<M:Main>(v:Array<String>):References<M>
+        return [for(s in v) Std.parseInt(s)];
+}

+ 1 - 0
tests/misc/projects/Issue5458/compile.hxml

@@ -0,0 +1 @@
+-main Main