The function returns an optional T?, which can say "missing" but can't carry an error. ?
on a T! would lose the error, so Auk asks you to decide explicitly.
Wrong#
fn parse(s: str): int? {
let n = int.parse(s)?
n
}Fixed#
fn parse(s: str): int? {
let n = int.parse(s) else { return none }
n
}Common causes#
- Mixing fallible (
T!) and optional (T?) calls in one function: pick one return type. - If callers need the reason, return
T!instead.