They differ in their ReflectedType
property:
The ReflectedType property retrieves the Type object that was used to obtain this instance of MemberInfo. This may differ from the value of the DeclaringType property if this MemberInfo object represents a member that is inherited from a base class.
So if you print out m1.ReflectedType
, it should print Human
. If you print out m2.ReflectedType
, it should print Man
.
EDIT: In terms of why the equality operator is implemented this way: it's always a delicate design decision to work out what ==
should mean, in the case where there may be distinguishable but not "primary" differences between objects. This is where providing different IEqualityComparer
implementations is useful, but of course that doesn't work for the operators themselves.
In general, if x == y
is true then it's quite unusual for x.Foo
to be different to y.Foo
for any property. I can't immediately think of any cases where that occurs in the framework.