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
enum Quality { Poor = 0, Common, Junk = 1 }print(Quality.Poor)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
Related codes
| code | message |
|---|---|
| E3010 | Enum mixes numeric and string values |
Offline
$ wowlua explain E3011 E3011 (error): Duplicate enum value