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#
fn label(n: int): str = nFixed#
fn label(n: int): str = str(n)Common causes#
- A missing conversion between
int,floatandstr. - A function without a return type (
: T) whose body produces a value: it returns(). ifandelsebranches that produce different types.returnwithout a value in a function that returns something.