ReSharper
 
Get ReSharper
Get your hands on the new features ahead of the release by joining the Early Access Program for ReSharper 2025.1! Learn more

Code inspection: Operator '==' or operator '!=' with 'Object.Equals(object o)' and 'Object.GetHashCode()' not overridden

Last modified: 11 February 2024

This code inspection warns you about not overridden Equals() and/or GetHashCode() methods in types that override == and/or != operators. Overridden equality operators imply that value equality should be applied for objects of this type, whereas the default implementation of Equals() and GetHashCode() that the class inherits from System.Object provide reference equality.

The inspection helps you detect the following compiler warnings before you compile: