Skip to content

Commit 70900aa

Browse files
authored
Improve error messages for function arity errors (#6990)
* Improve some error texts ("uncurried function" -> "function") * CHANGELOG
1 parent c4f5b1b commit 70900aa

14 files changed

+14
-13
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@
120120
- Fix `Js.Types.JSBigInt` payload to use native `bigint` type. https://github.com/rescript-lang/rescript-compiler/pull/6911
121121
- Deprecate `%external` extension, which has never been officially introduced. https://github.com/rescript-lang/rescript-compiler/pull/6906
122122
- Deprecate `xxxU` functions in Belt. https://github.com/rescript-lang/rescript-compiler/pull/6941
123+
- Improve error messages for function arity errors. https://github.com/rescript-lang/rescript-compiler/pull/6990
123124

124125
# 11.1.3
125126

jscomp/build_tests/super_errors/expected/arity_mismatch.res.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
2 │ let makeVariables = makeVar(.~f=f => f)
77
3 │
88

9-
This uncurried function has type (~f: 'a => 'a, unit) => int
9+
This function has type (~f: 'a => 'a, unit) => int
1010
It is applied with 1 arguments but it requires 2.

jscomp/build_tests/super_errors/expected/arity_mismatch2.res.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
2 │ let makeVariables = makeVar(. 1, 2, 3)
77
3 │
88

9-
This uncurried function has type ('a, unit) => int
9+
This function has type ('a, unit) => int
1010
It is applied with 3 arguments but it requires 2.

jscomp/build_tests/super_errors/expected/method_arity_mismatch.res.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
4 │ }
99
5 │
1010

11-
This uncurried function has type (int, int) => unit
11+
This function has type (int, int) => unit
1212
It is applied with 1 arguments but it requires 2.

jscomp/build_tests/super_errors/expected/moreArguments1.res.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
2 │ let y = x(~a=2) + 2
77
3 │
88

9-
This uncurried function has type (~a: int, ~b: int) => int
9+
This function has type (~a: int, ~b: int) => int
1010
It is applied with 1 arguments but it requires 2.

jscomp/build_tests/super_errors/expected/moreArguments2.res.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
2 │ let y = x(2) + 2
77
3 │
88

9-
This uncurried function has type (int, int) => int
9+
This function has type (int, int) => int
1010
It is applied with 1 arguments but it requires 2.

jscomp/build_tests/super_errors/expected/moreArguments3.res.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
2 │ let y = x(2) + 2
77
3 │
88

9-
This uncurried function has type (int, int, 'a, 'b) => int
9+
This function has type (int, int, 'a, 'b) => int
1010
It is applied with 1 arguments but it requires 4.

jscomp/build_tests/super_errors/expected/moreArguments4.res.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
2 │ let y = x(2) + 2
77
3 │
88

9-
This uncurried function has type (int, ~b: int, ~c: 'a, ~d: 'b) => int
9+
This function has type (int, ~b: int, ~c: 'a, ~d: 'b) => int
1010
It is applied with 1 arguments but it requires 4.

jscomp/build_tests/super_errors/expected/moreArguments5.res.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
5 │ let y = x(2).Sub.a
88
6 │
99

10-
This uncurried function has type (int, 'a, 'b, 'c) => Sub.a
10+
This function has type (int, 'a, 'b, 'c) => Sub.a
1111
It is applied with 1 arguments but it requires 4.

jscomp/build_tests/super_errors/expected/partial_app.res.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
5 │ f(1, 2)
88
6 │
99

10-
This uncurried function has type (int, int, int) => int
10+
This function has type (int, int, int) => int
1111
It is applied with 2 arguments but it requires 3.

0 commit comments

Comments
 (0)