E4124

E4124#

The constructor is ambiguous: it may come from multiple types.

Erroneous example#

pub enum A {
  A(Int)
  B(Bool)
  C(Double)
}

pub enum B {
  A(Double)
  B(Int)
  C(Bool)
}

pub fn use_a() -> Unit {
  ignore(A(1))
}

Suggestion#

Add T:: before the constructor:

pub enum  {
  ()
  ()
  ()
}

pub enum  {
  ()
  ()
  ()
}

pub fn () -> (, , , , , ) {
  (
    ::(1),
    ::(true),
    ::(1.0),
    ::(1.0),
    ::(1),
    ::(true),
  )
}