Right.Equals returns false for equal anonymous values
See original GitHub issuevar i1 = Right(1);
var i2 = Right(1);
Console.WriteLine(i1.Equals(i2)); // True
var a1 = new { x = 1 };
var a2 = new { x = 1 };
Console.WriteLine(a1.Equals(a2)); // True
var r1 = Right(a1);
var r2 = Right(a2);
Console.WriteLine(r1.Equals(r2)); // False
Shouldn’t the last comparison be true
as well?
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
c# - Why does Object.Equals() return false for identical ...
The first line of the Equals method checks whether value is an instance of AnonymousType<TName, TValue> , referring specifically to the class ...
Read more >In Java, is it possible for equals (==) to return false even if ...
For any object it is possible to return false. ... We must always use equals() function as it checks whether the values of...
Read more >Overriding equals() and hashCode() method in Java ...
@Anonymous, As per equals and hashcode contract, equals() method should return false if compared with null and also if two object are not...
Read more >How to Write an Equality Method in Java
Class java.lang.Object defines an equals method, which subclasses may override. Unfortunately, it turns out that writing a correct equality ...
Read more >Anonymous Types
Using anonymous types causes a smaller amount of data to be returned in the query. If you don't specify member names in the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You are right. That test does not pass for me. Somehow I got confused and thought that it passed for me.
Fixed in
3.3.40