docs

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

#E0029: cannot find enum variant

The enum has no variant of this name. Check the spelling against the enum's definition.

nabi
enum Light { Red, Green }

let l = Light::Yellow;
error[E0029]: enum `Light` has no variant `Yellow`
  --> main.nabi:3:9
   |
 3 | let l = Light::Yellow;
   |         ^^^^^^^^^^^^^

Use a variant the enum has, or add it to the enum:

nabi
#[derive(PartialEq)]
enum Light { Red, Green, Yellow }

let l = Light::Yellow;
println(f"{l == Light::Yellow}");
true

Related: E0027 cannot find value or function, E0103 binding looks like a variant

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