Skip to content

Commit 55627e3

Browse files
committedDec 8, 2022
Restore error where uncurried type is expected.
See #5888
1 parent 408008b commit 55627e3

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
We've found a bug for you!
3+
/.../fixtures/uncurried_expected.res:2:15-22
4+
5+
1 │ let apply = (f) => f(. 1)
6+
2 │ let z = apply(x => x+1)
7+
3 │
8+
9+
This expression is expected to have an uncurried function
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
let apply = (f) => f(. 1)
2+
let z = apply(x => x+1)

‎jscomp/ml/typecore.ml

-4
Original file line numberDiff line numberDiff line change
@@ -3755,10 +3755,6 @@ let report_error env ppf = function
37553755
fprintf ppf "it should have type@ %a"
37563756
type_expr ty
37573757
end else begin
3758-
match ty with
3759-
| {desc = Tconstr (Pdot (Pdot(Pident {name = "Js"},"Fn",_),_,_),_,_)} ->
3760-
fprintf ppf "This expression is excpeted to have an uncurried function"
3761-
| _ ->
37623758
fprintf ppf "This expression should not be a function,@ ";
37633759
fprintf ppf "the expected type is@ %a"
37643760
type_expr ty

‎jscomp/super_errors/super_typecore.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ let report_error env ppf = function
230230
type_expr ty
231231
end else begin
232232
match ty with
233-
| {desc = Tconstr (Pdot (Pdot(Pident {name = "Js"},"Fn",_),_,_),_,_)} ->
233+
| {desc = Tconstr (Pident {name = "function$"},_,_)} ->
234234
fprintf ppf "This expression is expected to have an uncurried function"
235235
| _ ->
236236
fprintf ppf "@[This expression should not be a function,@ ";

0 commit comments

Comments
 (0)