Xo is experimental. The source code is not public yet; it will be soon. Read the release notes
Menu · XO0204

Docs

XO0204: `?` on an Option in a function returning a Result

error · reported by the checker

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.