E4057

E4057#

Compiler diagnostic name: constructor_duplicate.

The constructor is duplicate. Constructors in the same enum must have unique names so construction and pattern matching can identify one variant unambiguously.

Erroneous example#

///|
enum E {
  A
  A(Int)
}

Suggestion#

Rename the constructor to a different name.

///|
priv enum E {
  A
  B(Int)
}

///|
test {
  let value = E::B(1)
  ignore(E::A)
  match value {
    A => inspect("A")
    B(n) => inspect(n, content="1")
  }
}