The call passes a different number of arguments than the function takes. Remember that a dot
call counts the receiver: x.f(a) is f(x, a), two arguments.
Wrong#
fn add(a: int, b: int): int = a + b
fn main() { print(add(1)) }Fixed#
fn add(a: int, b: int): int = a + b
fn main() { print(add(1, 2)) }Common causes#
- A forgotten or extra argument.
- Counting a dot call's receiver twice:
xs.push(xs, 1)instead ofxs.push(1). - Default arguments from other languages: Auk has none; add an overload with fewer parameters.