Generic Record Types have different Equality semantics to concrete types #527
Labels
Area-Compiler-Optimization
The F# optimizer, release code gen etc.
Bug
Impact-Low
(Internal MS Team use only) Describes an issue with limited impact on existing code.
Milestone
From #513
The problem is that for concrete types, the implementation of IStructuralEquatable optimizes standard types, which means that the IEqualityComparer is unused.
The following example shows this by using a specialized IEqualityComparer to try to do an uppercase string comparison.
With the output
I think the implementation of IStructuralEquatable.Equals shouldn't used inlined IL, but rather always defer back to supplied IEqualityComparer.
Fixing this before #513 is implemented would have a performance impact.
The text was updated successfully, but these errors were encountered: