Error codes

E0110: clauses disagree on the return type

In a terminal: auk explain E0110 prints this page.

On this page

All clauses of a function return the same type. Here one clause declares a different return type than an earlier one.

Wrong#

auk
fn name(0): str = "zero"
fn name(n: int): int = n

Fixed#

auk
fn name(0): str = "zero"
fn name(n: int): str = str(n)

Common causes#

  • A typo in one clause's return type.
  • A clause that should convert its result (str(n), float(n)).
  • Write the return type once in a header line (fn name(n: int): str) above the clauses.

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