Lyricdev
GitHub

LYR-SEM0103

a loop label nothing jumps to

warning · spec 07-statements · lint unused-label, group unused, warn unless said

A loop carries a label, and no 'break' or 'continue' in its body names it.

Explanation

A label exists to be named by break label or continue label. One that no jump names says nothing about the program and is likely the leftover of an edit — or a jump meant for it names another loop. The warning is the label's counterpart of an unused binding.

Remove the label, or name it in the jump that was meant to use it.

Wrong

fn main(): void {
    var n = 0;
    outer: while (n < 3) {
        n += 1;
    }
}
fn main(): void {
    var n = 0;
    while (n < 3) {
        n += 1;
    }
}