E4072

E4072#

Method of trait already has a default implementation.

错误示例#

trait T {
  to_int(Self) -> Int
}

type A Int

impl T with to_int(self : Self) -> Int {
  0
}

impl T with to_int(self : Self) -> Int { // Error: Method to_int of trait T already has a default implementation at
  0
}

建议#

Remove the duplicated default implementation of the trait.

impl T with to_int(self : Self) -> Int {
  0
}

// Remove this implementation
// impl T with to_int(self : Self) -> Int {
//   0
// }