Skip to content
ZOLO / TE227 Type · error

break or continue used outside a loop

Compiler diagnostic TE227: break or continue used outside a loop.

Why this fires

An unlabelled break or continue appears outside a loop. These statements can only transfer control within an enclosing loop, while, or for.

fn invalid() {
    break // error[TE227]
}

Fix it

Move the statement into the loop it controls. To leave a function, use return instead.

See also

  • TE225 — a labelled exit names no active loop.

Global index

Find your way through Zolo

Try an idea

Start here

9 results

9 results

en