See a missing match case
Finite types let moon prove exactly which cases are missing. This match handles some but omits none, so Check names the uncovered case.
Add none => 0. A catch-all also closes the match, but explicit finite cases preserve the checker's help when the type later grows.
fn number(value: Optional<int>) -> int {
match value {
some(inner) => inner,
}
}
fn main() {}
Detailed reference →
Examples use the moon toolchain version shown beside each result.