else e => ... binds the error of a T!. A T? has no error, just a missing value, so there
is nothing to bind: write a plain else fallback.
Wrong#
fn main() {
let x = [1].first() else e => 0
print(x)
}Fixed#
fn main() {
let x = [1].first() else 0
print(x)
}Common causes#
- Treating an optional lookup (
first,find,get) as fallible. - Copying an error-handling pattern from a
T!call.