diff --git a/jscomp/build_tests/super_errors/expected/uncurried_expected.res.expected b/jscomp/build_tests/super_errors/expected/uncurried_expected.res.expected new file mode 100644 index 0000000000..cb4afd42cf --- /dev/null +++ b/jscomp/build_tests/super_errors/expected/uncurried_expected.res.expected @@ -0,0 +1,9 @@ + + We've found a bug for you! + /.../fixtures/uncurried_expected.res:2:15-22 + + 1 │ let apply = (f) => f(. 1) + 2 │ let z = apply(x => x+1) + 3 │ + + This expression is expected to have an uncurried function \ No newline at end of file diff --git a/jscomp/build_tests/super_errors/fixtures/uncurried_expected.res b/jscomp/build_tests/super_errors/fixtures/uncurried_expected.res new file mode 100644 index 0000000000..6fad3ef0ab --- /dev/null +++ b/jscomp/build_tests/super_errors/fixtures/uncurried_expected.res @@ -0,0 +1,2 @@ +let apply = (f) => f(. 1) +let z = apply(x => x+1) diff --git a/jscomp/ml/typecore.ml b/jscomp/ml/typecore.ml index 6ba5b4f0f6..25527b7d74 100644 --- a/jscomp/ml/typecore.ml +++ b/jscomp/ml/typecore.ml @@ -3755,10 +3755,6 @@ let report_error env ppf = function fprintf ppf "it should have type@ %a" type_expr ty end else begin - match ty with - | {desc = Tconstr (Pdot (Pdot(Pident {name = "Js"},"Fn",_),_,_),_,_)} -> - fprintf ppf "This expression is excpeted to have an uncurried function" - | _ -> fprintf ppf "This expression should not be a function,@ "; fprintf ppf "the expected type is@ %a" type_expr ty diff --git a/jscomp/super_errors/super_typecore.ml b/jscomp/super_errors/super_typecore.ml index e91282740b..cef6a7ec0a 100644 --- a/jscomp/super_errors/super_typecore.ml +++ b/jscomp/super_errors/super_typecore.ml @@ -230,7 +230,7 @@ let report_error env ppf = function type_expr ty end else begin match ty with - | {desc = Tconstr (Pdot (Pdot(Pident {name = "Js"},"Fn",_),_,_),_,_)} -> + | {desc = Tconstr (Pident {name = "function$"},_,_)} -> fprintf ppf "This expression is expected to have an uncurried function" | _ -> fprintf ppf "@[This expression should not be a function,@ ";