DeepEqual icon indicating copy to clipboard operation
DeepEqual copied to clipboard

Fix incorrect comparison for value types containing reference fields

Open rokklobster opened this issue 4 years ago • 0 comments

DefaultComparison have higher priority than ComplexComparison, and value types are checked using this comparison. However, due to Equals semantics for value types, if type contains field of reference type, fields are compared using referential equality.

Fix introduces check whether types compared are value types holding reference type fields in both DefaultComparison and ComplexComparison. Added a test to check this behavior; all tests green

rokklobster avatar Jan 22 '21 13:01 rokklobster