smurfpandey / morelinq

Automatically exported from code.google.com/p/morelinq
Apache License 2.0
0 stars 0 forks source link

DistinctBy should allow a null comparer #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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.

Original issue reported on code.google.com by azizatif on 15 Feb 2009 at 6:58

GoogleCodeExporter commented 9 years ago
Fixed in r5.

Original comment by azizatif on 15 Feb 2009 at 7:01