Error codes

E0200: mismatched types

In a terminal: auk explain E0200 prints this page.

On this page

A value of one type was used where another type is expected. Auk has no implicit conversions (not even int to float), so every conversion is visible in the code: float(n), int(x), str(v).

Wrong#

auk
fn label(n: int): str = n

Fixed#

auk
fn label(n: int): str = str(n)

Common causes#

  • A missing conversion between int, float and str.
  • A function without a return type (: T) whose body produces a value: it returns ().
  • if and else branches that produce different types.
  • return without a value in a function that returns something.

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