OxL Reference

error bad-label

error Standard: [§1.3]

What it means#

break 'name and continue 'name must refer to a label of an enclosing loop, introduced as 'name: for ... (§1.3, §5.6).

Example#

oxl✓ checked in CI
fn main() {
  for a in [1, 2] {
    for b in [1, 2] {
      if a == b { break 'outer }      // <- bad-label
    }
  }
}
error
bad-label

How to fix#

oxl✓ checked in CI
fn main() {
  'outer: for a in [1, 2] {
    for b in [1, 2] {
      if a == b { break 'outer }
    }
  }
}

Declare the label on the outer loop, or correct its name.

See also#

OxL 1.0.0-beta · Documentation version 1.0.0-beta© OxwaldLink · generated from the Standard, the std sources and the guides