LYR-PAR0017
a '{' is missing, or a body without braces
The body of if, else, while, do or for is a single statement without braces, or a block, a match body, or the body of a struct, class, enum, interface or extend does not open with {.
Explanation
The body of a control statement is a block, braced even around one statement: if (c) { f(); }. A braceless body is refused once and read as the block it belongs in. Declarations and match open their bodies with { as well.
Put the body in braces.
Wrong
fn main(): void {
let c = true;
var n = 0;
if (c) n = 1;
}
Right
fn main(): void {
let c = true;
var n = 0;
if (c) {
n = 1;
}
let _ = n;
}