Lyricdev
GitHub

LYR-PAR0020

a binding without its name, pattern or value

error · spec 07-statements

A let, var, loop variable or catch binding has no name (a reserved word stands there, read as the name); a pattern binding or destructuring has no = and value; a let condition has no =; or a module-level or static binding takes a pattern.

Explanation

A binding names what it binds: let x = …, for (x in xs), catch (e). A reserved word is no name; it is refused once, with a note, and read as the name. A binding through a pattern takes its value apart, so it needs one: let (a, b) = pair;. A module-level or static binding is one named slot and takes no pattern.

Choose a name that is not a keyword, or give the pattern its value.

Wrong

fn main(): void {
    let match = 1;
}
fn main(): void {
    let found = 1;
    let _ = found;
}