v0.13.7
errors and warnings / classes

errors and warnings / classes / E3011

E3011 error

Duplicate enum value

area
classes (x3xxx)
fails the build
yes

Two members of an enum have the same value, or the same name. Members without a value count on from the previous one, so a later explicit value can clash with one counted earlier. Give each member its own value.

Example

× failswowlua
enum Quality { Poor = 0, Common, Junk = 1 }print(Quality.Poor)
✓ compileswowlua
enum Quality { Poor = 0, Common, Junk = 2 }print(Quality.Poor)

The compiler reports it like this:

error[E3011]: duplicate value in enum `Quality`
  ┌─ src/main.wowlua:1:34
  │
1 │ enum Quality { Poor = 0, Common, Junk = 1 }
  │                                  ^^^^ this value is used by an earlier member
codemessage
E3010Enum mixes numeric and string values

Offline

terminal
$ wowlua explain E3011
E3011 (error): Duplicate enum value

source on GitHub ↗