diff --git a/src/typing/typeload.ml b/src/typing/typeload.ml index 03b4e434ef6..5cf0f79fe5c 100644 --- a/src/typing/typeload.ml +++ b/src/typing/typeload.ml @@ -766,7 +766,7 @@ and type_type_params ctx host path p tpl = | TInst (c2,_) when ttp.ttp_class == c2 -> raise_typing_error "Recursive constraint parameter is not allowed" p | TInst ({ cl_kind = KTypeParameter ttp },_) -> - List.iter loop (get_constraints ttp) + delay ctx.g PConnectField (fun () -> List.iter loop (get_constraints ttp)) | _ -> () in diff --git a/tests/misc/projects/Issue11870/Main.hx b/tests/misc/projects/Issue11870/Main.hx new file mode 100644 index 00000000000..dafdb3e0a69 --- /dev/null +++ b/tests/misc/projects/Issue11870/Main.hx @@ -0,0 +1,2 @@ +function copyValue() {} +function main() {} diff --git a/tests/misc/projects/Issue11870/compile-fail.hxml b/tests/misc/projects/Issue11870/compile-fail.hxml new file mode 100644 index 00000000000..a13a821bd35 --- /dev/null +++ b/tests/misc/projects/Issue11870/compile-fail.hxml @@ -0,0 +1 @@ +--run Main diff --git a/tests/misc/projects/Issue11870/compile-fail.hxml.stderr b/tests/misc/projects/Issue11870/compile-fail.hxml.stderr new file mode 100644 index 00000000000..7385a88376b --- /dev/null +++ b/tests/misc/projects/Issue11870/compile-fail.hxml.stderr @@ -0,0 +1 @@ +Main.hx:1: characters 1-34 : Recursive constraint parameter is not allowed \ No newline at end of file