Lyricdev
GitHub

LYR-PAR0035

match arms without ',' between them

error ยท spec 09-patterns

A match arm whose body is an expression is followed by another arm without a ,.

Explanation

An arm with an expression body ends with ,, unless it is the last; an arm with a block body ends with its } and may leave the comma off.

Write , after the arm.

Wrong

fn main(): void {
    let n = 1;
    let s = match (n) {
        1 => "one"
        _ => "many",
    };
}
fn main(): void {
    let n = 1;
    let s = match (n) {
        1 => "one",
        _ => "many",
    };
    let _ = s;
}