Skip to content

Commit

Permalink
singular on 1 args
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianoc committed Feb 7, 2025
1 parent 69c8067 commit 1607d1b
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion compiler/ml/typecore.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4464,7 +4464,7 @@ let report_error env ppf error =
"@ @[It is applied with @{<error>%d@} argument%s but it requires \
@{<info>%d@}.@]@]"
args
(if args = 0 then "" else "s")
(if args = 1 then "" else "s")
arity
| Field_not_optional (name, typ) ->
fprintf ppf "Field @{<info>%s@} is not optional in type %a. Use without ?"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
3 │

This function has type (~f: 'a => 'a, unit) => int
It is applied with 1 arguments but it requires 2.
It is applied with 1 argument but it requires 2.
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
5 │

This function has type (int, int) => unit
It is applied with 1 arguments but it requires 2.
It is applied with 1 argument but it requires 2.
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
3 │

This function has type (~a: int, ~b: int) => int
It is applied with 1 arguments but it requires 2.
It is applied with 1 argument but it requires 2.
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
3 │

This function has type (int, int) => int
It is applied with 1 arguments but it requires 2.
It is applied with 1 argument but it requires 2.
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
3 │

This function has type (int, int, 'a, 'b) => int
It is applied with 1 arguments but it requires 4.
It is applied with 1 argument but it requires 4.
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
3 │

This function has type (int, ~b: int, ~c: 'a, ~d: 'b) => int
It is applied with 1 arguments but it requires 4.
It is applied with 1 argument but it requires 4.
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
6 │

This function has type (int, 'a, 'b, 'c) => Sub.a
It is applied with 1 arguments but it requires 4.
It is applied with 1 argument but it requires 4.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

1 │ let f = (~a=0, b, c) => a + b + c
2 │ let x = f(42)
3 │

This function has type (~a: int=?, int, int) => int
It is applied with 1 arguments but it requires 2.
It is applied with 1 argument but it requires 2.
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@

This function has type
((option<'a>, ([> #List(list<'b>)] as 'b)) => 'c, 'd) => 'c
It is applied with 1 arguments but it requires 2.
It is applied with 1 argument but it requires 2.
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
5 │ }

This function has type (int, int) => int
It is applied with 1 arguments but it requires 2.
It is applied with 1 argument but it requires 2.
2 changes: 1 addition & 1 deletion tests/build_tests/super_errors/fixtures/opt_args_arity.res
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
let f = (~a=0, b, c) => a + b + c
let x = f(42)
let x = f(42)

0 comments on commit 1607d1b

Please sign in to comment.