From the spec:
The record type implements
System.IEquatable<R>
and includes a
synthesized strongly-typed overload ofEquals(R? other)
whereR
is the
record type. The method ispublic
, and the method isvirtual
unless
the record type issealed
.
What is the real purpose of having the method declared as virtual
when we can’t really override it with user code in derived classes since it’s auto-implemented by the compiler? What does the compiler’s auto-generated implementation guarantee for records to work well that we couldn’t live without otherwise?
return Equals((object)other);