c# - overload Equals, is this wrong? -


Reading some pieces of code and I'm looking at it:

  public override bull Akles (object obj) {if (obj == faucet} this.GetType () .Equals (obj.GetType ())) false return; // Compare code ...}  

It should not be so (note!):

  public override bool par (object obj) { If (obj == zero ||! This.GetType () .Equals (obj.GetType ())) false return; // compare code ...}  

or equivalent in this case?

It looks like a bug Returning false When the type is identical, surely the desired behavior Does not happen.


Comments