Rudy Ges 6 months ago
parent
commit
24daf4cd48

+ 12 - 0
tests/misc/projects/Issue6066/Main.hx

@@ -0,0 +1,12 @@
+typedef S = {a:Int, ?b:Int};
+
+class Main {
+    static function f1(a:S):Void {}
+    static function f2<T:S>(a:T):Void {}
+
+    static function main() {
+        f1({a: 1}); // works
+        f2({a: 1}); // Constraint check failure: { a : Int } should be { ?b : Null<Int>, a : Int }
+        f2(({a: 1} : S)); // works
+    }
+}

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

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