The pattern could never match because it describes a different type than the value being
matched, such as a string pattern against an int.
Wrong#
fn f(x: int): int = match x {
"a" => 1
_ => 2
}Fixed#
fn f(x: int): int = match x {
1 => 1
_ => 2
}Common causes#
- Matching on the wrong variable.
- A pattern for a different enum, or a variant from another type.
- A map pattern whose key type differs from the map's key type.