Skip to content
ZOLO / TE228 Type · error

break value targets a statement loop

Compiler diagnostic TE228: break value targets a statement loop.

Why this fires

A break carrying a value targets while or for. Only the unconditional loop form is a value-producing expression.

while ready() {
    break 1 // error[TE228]
}

Fix it

Remove the value, assign it before breaking, or use a value-producing loop.

let answer: int = loop {
    break 1
}

See also

  • TE229 — break values disagree with a loop's result type.

Global index

Find your way through Zolo

Try an idea

Start here

9 results

9 results

en