A fn line with no body is a header line (docs, pub, contracts) for the clauses that follow
it. Here no clauses follow, or the body-less fn comes after its clauses.
Wrong#
fn double(n: int): int
fn main() { print(1) }Fixed#
fn double(n: int): int = n * 2
fn main() { print(double(1)) }Common causes#
- A forward declaration as in C: Auk doesn't need one; just give the function a body.
- A forgotten
= expror{ ... }. - The header written after the clauses: move it above them.