Equality testing can also use either value or pointer semantics.
Data fields can be compaired bitwise, or (better) recursively using whatever equality means for the data fields.
If programmers can define new meanings for equality, there is no guarantee that it even remains communtative. It can happen that x = y, but not y = x !