本頁尚未翻譯,以下為英文原文。
#E0022: let without a value
Every let gives its variable a value. Write one, let n: i32 = 0;, or start it empty with an optional type: let n: i32 | none = none;.
nabi
let n: i32;
error[E0022]: `let n` needs a value --> main.nabi:1:11 | 1 | let n: i32; | ^ | = help: give it one, `let n: i32 = ..;`, or start it empty: `let n: i32 | none = none;`
Start it with a value, or with none and an optional type:
nabi
let n: i32 | none = none;
println(f"{n ?? 0}");
0
Related: E0042 type annotations needed
Found a mistake? Edit this page on GitHub. Last updated