You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
publicrecordFoo(intA){publicvirtualboolEquals(Foo?other){if(otherisnull){returnfalse;}returnA.Equals(other.A);}publicoverrideintGetHashCode()=>A.GetHashCode();}publicrecordBar(intA,intB):Foo(A){publicvirtualboolEquals(Bar?other)=>base.Equals(other);// CS8851 if you don't add the next linepublicoverrideintGetHashCode()=>base.GetHashCode();// RCS1132, but removing the method implies a behavior change}
Actual Behavior:
RCS1132
Expected Behavior:
No action triggered.
The text was updated successfully, but these errors were encountered:
If calling a custom implemented GetHashCode as in this example, it does not make sense but if we are calling the compiler generated GetHashCode it is ok to use it because hash code of EqualityContract property is also combined.
Product and Version Used:
Steps to Reproduce:
Actual Behavior:
RCS1132
Expected Behavior:
No action triggered.
The text was updated successfully, but these errors were encountered: