Lyricdev
GitHub

LYR-PAR0046

a label on something that is no loop

error ยท spec 07-statements

A label name: stands before a statement that is not while, do, for or loop.

Explanation

A label names a loop, so that break name and continue name can leave or go on with it from inside a nested one. On any other statement it would name nothing those two can reach.

Put the label before a loop, or remove it.

Wrong

fn main(): void {
    outer: let x = 1;
}
fn main(): void {
    outer: while (true) {
        break outer;
    }
}