Skip to content

Remove errors for curried application of uncurried functions. #5890

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
2 changes: 0 additions & 2 deletions jscomp/ml/typecore.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3672,8 +3672,6 @@ let report_error env ppf = function
type_expr typ;
fprintf ppf "@ @[It is applied to too many arguments;@ %s@]@]"
"maybe you forgot a `;'."
| Tconstr (Pdot (Pdot(Pident {name = "Js"},"Fn",_),_,_),_,_) ->
fprintf ppf "This function has uncurried type, it needs to be applied in ucurried style";
| _ ->
fprintf ppf "@[<v>@[<2>This expression has type@ %a@]@ %s@]"
type_expr typ
Expand Down
13 changes: 0 additions & 13 deletions jscomp/super_errors/super_typecore.ml
Original file line number Diff line number Diff line change
Expand Up @@ -202,19 +202,6 @@ let report_error env ppf = function
type_expr typ;
fprintf ppf "@ @[It only accepts %i %s; here, it's called with more.@]@]"
acceptsCount (if acceptsCount == 1 then "argument" else "arguments")
| Tconstr (
(Path.Pdot (((Pdot (Path.Pident {name="Js"}, "Fn", _)) ), _, _)),
_,
_
)
->
fprintf
ppf
"@[<v>This is an uncurried ReScript function. @{<info>It must be applied with a dot@}.@,@,\
Like this: @{<info>foo(. a, b)@}@,\
Not like this: @{<dim>foo(a, b)@}@,@,\
This guarantees that your function is fully applied. More info here:@,\
https://rescript-lang.org/docs/manual/latest/function#uncurried-function@]"
| _ ->
fprintf ppf "@[<v>@[<2>This expression has type@ %a@]@ %s@]"
type_expr typ
Expand Down