Ruta graveolens  ·  notes from a language experiment  ·  cultivated since 2025

E0206: Type mismatch

CodeCategoryStability
E0206SemanticPermanent

Explanation

An expression's type was incompatible with the type required by its surrounding context.

Likely cause

A return value, call argument, assignment, annotation, operator operand, or other expected-type position received a different concrete type without an allowed coercion.

Examples

Wrong return type

fn main() -> i32 {
    true
}

Return the declared type

fn main() -> i32 {
    0
}

References