Lyricdev
GitHub

LYR-PAR0034

a match arm without '=>'

error ยท spec 09-patterns

A match arm's pattern, or its guard, is not followed by =>.

Explanation

A match arm is a pattern, an optional if guard, =>, and the arm's body.

Write => between the pattern and the body.

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;
}