XO0204: `?` on an Option in a function returning a Result
opt? returns None from a function that returns an optional. In a function that returns a Result there is no error value to return for None, so say which error a missing value is: opt.or_err(E.Missing)?. The diagnostic offers that fix. See core 2.5.
Example
enum E { Missing }
fn f(s: Str?) -> Str ! E { s? }Fix
enum E { Missing }
fn f(s: Str?) -> Str ! E { s.or_err(E.Missing)? }Run xo explain XO0204 for this text in a terminal, or see
section 10.6 of the specification.