Error codes

E0370: unsupported main signature

In a terminal: auk explain E0370 prints this page.

On this page

main may take no parameters or args: [str], and return nothing, int (the exit code), ()! or int! (an error prints and exits with 1). Other signatures can't be called by the runtime.

Wrong#

auk
fn main(n: int) {
  print(n)
}

Fixed#

auk
fn main(args: [str]) {
  print(args.len())
}

Common causes#

  • Expecting parsed arguments: take args: [str] and parse with int.parse(args[1]).
  • Returning a type other than int, () or their ! forms.

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