E4124

E4124#

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

错误示例#

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

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

fn main {
  let a = A(1) // Error: The constructor A is ambiguous: it may come from type B or A.
}

建议#

Add T:: before the constructor:

fn main {
  let a = A::A(1)
}