docs

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

#E0113: invalid #[keyword] declaration

#[keyword("name")] goes on a free function, its handler, and name is an identifier that is not already a keyword.

nabi
#[keyword("if")]
fn my_if(c: bool) -> bool { c }
error[E0113]: `#[keyword("if")]`: `if` is already a keyword
  --> main.nabi:1:1
   |
 1 | #[keyword("if")]
   | ^^

Pick a name that is not a keyword yet, such as #[keyword("unless")].

Related: E0021 reserved word used as a name, E0123 registered twice

Found a mistake? Edit this page on GitHub. Last updated