Error codes

E0035: return types use :, not ->

In a terminal: auk explain E0035 prints this page.

On this page

Auk writes a function's return type after a colon, like every other type annotation: fn add(a: int, b: int): int. The -> arrow from Rust, Python or Swift is rejected (with a fix).

Wrong#

auk
fn add(a: int, b: int) -> int = a + b

Fixed#

auk
fn add(a: int, b: int): int = a + b

Common causes#

  • Habit from Rust, Python type hints or Swift.
  • Function types in parameters are written (int) => int, not int -> int.

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