Lyricdev
GitHub

LYR-PAR0019

a '(' is missing after a keyword

error · spec 07-statements

if, while, for, match or catch is not followed by (, or a function's name is not followed by its parameter list.

Explanation

The condition of if and while, the header of for, the value of match and the binding of catch stand in parentheses: if (c) { … }. A function declaration has its parameters in parentheses, fn f(), even when there are none.

Write the (.

Wrong

fn main(): void {
    let c = true;
    if c) {
    }
}
fn main(): void {
    let c = true;
    if (c) {
    }
}