class Parent {
class Child : IEquitable<Child> {
private readonly int index;
private readonly Parent parent;
internal Child(Parent parent, int index) {
this.parent = parent;
this.index = index;
}
public override int GetHashCode() {
return parent.GetHashCode()*31 + index.GetHashCode();
}
public override bool Equals(object obj) {
Child other = obj as Child.
return other != null && Equals(other);
}
public override bool Equals(Child other) {
// The warning I get is on the next line:
return parent == other.parent && index == other.index;
}
}
...
}