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

Docs

XO0163: unparenthesized struct literal in a condition

error · reported by the parser

In the condition of if, while, for, match, requires, or ensures, a { opens the body, so a struct literal or struct pattern (p is Point{x: 0, ..}) there is ambiguous. Parenthesize the condition, as in Go. The diagnostic carries that fix. See core 1.4.

Example

struct Point { x: Int }

fn f(p: Point) -> Bool {
  if p == Point{x: 0} {
    true
  } else {
    false
  }
}

Fix

struct Point { x: Int }

fn f(p: Point) -> Bool {
  if (p == Point{x: 0}) {
    true
  } else {
    false
  }
}

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