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

`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

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

## Fix

```xo
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](../../spec/core/#106-diagnostic-codes).

