docs

You are reading the docs for v0.1.2. Nabi 0.1.2 is no longer supported. Latest release: v0.1.3 →

#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