E4066

E4066#

Overloaded operator has inconsistent parameter type.

You can refer to the Operator Overloading section for a list of operators that can be overloaded, and respectively their expected signature.

错误示例#

type A Int
fn A::op_add(self : A, other : Int) -> A {
  return self._ + other
}

建议#

Modify the method to match the expected parameter type of the operator. If you use the name for overloaded operators by accident, you can rename the method to a different name.

fn A::op_add(self : A, other : A) -> A {
  self._ + other._
}