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

Docs

XO0607: `break` or `continue` outside a loop, or an unknown label

error · reported by the checker

break and continue must be inside a loop of the same function or closure, and a label must name an enclosing labeled loop (outer: for ... { break outer }). Inside a closure, return leaves the closure; a loop outside it cannot be broken from inside. See core 3.5.

Example

fn f(xs: List[Int]) {
  for _x in xs {
    break outr
  }
}

Fix

fn f(xs: List[Int]) {
  outer: for _x in xs {
    break outer
  }
}

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