Browse Source

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

Rudy Ges 7 months ago
parent
commit
5fef762a78
2 changed files with 18 additions and 0 deletions
  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