x?.f continues only when the optional x is present. On a T! it would silently drop the
error, so Auk asks you to pass it up first: (x?).f.
Wrong#
fn load(): str! = "a"
fn main(): ()! { print(load()?.len()) }Fixed#
fn load(): str! = "a"
fn main(): ()! { print((load()?).len()) }Common causes#
- Treating
T!likeT?: write(x?).f()to pass the error up, then call. - Use
elsefor a fallback:(load() else "").len().