Replies: 1 comment 4 replies
-
Probably because you can't do sequence-based equal for everything that implements |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I read the document: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-9.0/records
It said that The synthesized Equals(R?) returns true if and only if each of the following are true:
There is a rule that confused me: the value of System.Collections.Generic.EqualityComparer.Default.Equals(fieldN, other.fieldN) where TN is the field type
In my case, I have a record type like:
Then I want to compare between two Order instances, that fails. I think it because record type is not field.
So why don't the records make sequence equal compare in Collection?
Beta Was this translation helpful? Give feedback.
All reactions