Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DistinctBy should allow a null comparer #3

Closed
atifaziz opened this issue Aug 21, 2015 · 1 comment
Closed

DistinctBy should allow a null comparer #3

atifaziz opened this issue Aug 21, 2015 · 1 comment

Comments

@atifaziz
Copy link
Member

Originally reported on Google Code with ID 3

What steps will reproduce the problem?

int[] source = { 1, 2, 3, 2, 1 };
source.DistinctBy(x => x, null);

What is the expected output? What do you see instead?

The expected output is { 1, 2, 3 } assuming the default comparer 
implementation since a null comparer is supplied. This would be consistent 
with the Enumerable.Distinct operator from Microsoft's base LINQ-to-
Objects implementation. However, what one sees instead is a 
ArgumentNullException from DistinctBy.

Reported by azizatif on 2009-02-15 18:58:27

@atifaziz
Copy link
Member Author

Fixed in r5.

Reported by azizatif on 2009-02-15 19:01:23

  • Status changed: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant