Error codes

E0300: wrong number of arguments

In a terminal: auk explain E0300 prints this page.

On this page

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#

auk
fn add(a: int, b: int): int = a + b
fn main() { print(add(1)) }

Fixed#

auk
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 of xs.push(1).
  • Default arguments from other languages: Auk has none; add an overload with fewer parameters.

Stuck on a word? Try the glossary. Got a compiler error? Look up its code. Improve this page