E4154

E4154#

Non-constant enum with custom tag value.

MoonBit supports customizing the integer representation of constructors:

enum Flag {
  A = 1
  B = 2
  C = 3
}

However, only constant enum (all constructors have not payload) can have custom tag. Otherwise this error will be reported.

Erroneous example#

enum Bad {
  A = 1
  B = 2
  C(Int)
}