Skip to content

Restore error where uncurried type is expected. #5891

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
let apply = (f) => f(. 1)
let z = apply(x => x+1)
4 changes: 0 additions & 4 deletions jscomp/ml/typecore.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion jscomp/super_errors/super_typecore.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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,@ ";
Expand Down