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

Docs

XO0302: pattern does not fit the type of the matched value

error · reported by the checker

The pattern can never match because it describes a different type: a variant of another enum, Ok on an optional, a literal of the wrong type, a tuple of the wrong size, a list pattern on a non list. It also covers malformed variant and struct patterns: parentheses on a variant without fields (or none on one with fields), too many or repeated fields, and fields left unmentioned without ... See core 3.5.

Example

fn f(o: Int?) -> Bool {
  o is Ok(_)
}

Fix

fn f(o: Int?) -> Bool {
  o is Some(_)
}

Run xo explain XO0302 for this text in a terminal, or see section 10.6 of the specification.