Lyricdev
GitHub

LYR-PAR0016

a ';' is missing

error · spec 07-statements

A statement is not ended by ;; a function has neither a body { … } nor a ;; an extern declaration is not ended by ;. Within a statement block, a value without ; before the end of a block is refused too.

Explanation

A statement ends with ;, unless it ends in a block of its own (if, while, a call with a trailing block). Only the last expression of a value block — a lambda's body, a match arm, a branch — stands without one, as the block's value.

Write the ;.

Wrong

fn main(): void {
    let a = 1
    let b = 2;
}
fn main(): void {
    let a = 1;
    let b = 2;
    let _ = a + b;
}