Error codes

E0117: a bare variant name would be core's Value variant where another enum is meant

In a terminal: auk explain E0117 prints this page.

On this page

A bare variant name is resolved by the expected type, looking through T?, T! and T!E: fn next(): tok.Tok!Fail = Float(x) builds tok.Tok.Float. Core's Value (Int, Float, Str, List, ...) is always in scope, so Auk refuses to pick a Value variant silently when the expected type is another enum without that variant, or when nothing says which type is expected and an enum of this package has a variant of that name. Write the variant with its module (tok.Float(x)), give the expected type, or write Value.Float(x) for core's Value.

Wrong#

The project has a module src/tok.auk:

toml
[package]
name = "app"
version = "0.1.0"
auk
pub enum Tok { Int(n: int), Float(f: float), Eof }
auk
fn main() {
  let t = Float(1.5)
  print(t)
}

Fixed#

auk
fn main() {
  let t = tok.Float(1.5)
  print(t)
}

Common causes#

  • A let without a type whose value is a bare variant of another module's enum.
  • A variant the expected enum doesn't have (a typo, or the wrong enum).

Stuck on a word? Try the glossary. Got a compiler error? Look up its code. Improve this page