Skip to content

Commit

Permalink
Add test for #6066 (#11936)
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz authored Jan 22, 2025
1 parent b2665f7 commit 24daf4c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/misc/projects/Issue6066/Main.hx
Original file line number Diff line number Diff line change
@@ -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 change: 1 addition & 0 deletions tests/misc/projects/Issue6066/compile.hxml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-main Main

0 comments on commit 24daf4c

Please sign in to comment.