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

Fix "FullGroupJoin" signature with more honest nullable annotations #806

Merged
merged 3 commits into from
Mar 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion MoreLinq.Test/FullGroupJoinTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
// limitations under the License.
#endregion

#nullable enable

namespace MoreLinq.Test
{
using System;
Expand Down Expand Up @@ -135,7 +137,7 @@ public void FullGroupPreservesOrder(OverloadCase overloadCase)
switch (overloadCase)
{
case CustomResult:
return listA.FullGroupJoin(listB, getKey, getKey, ValueTuple.Create);
return listA.FullGroupJoin(listB, getKey, getKey, ValueTuple.Create, comparer: null);
case TupleResult:
return listA.FullGroupJoin(listB, getKey, getKey);
default:
Expand Down
4 changes: 2 additions & 2 deletions MoreLinq/Extensions.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2391,7 +2391,7 @@ public static partial class FullGroupJoinExtension
IEnumerable<TSecond> second,
Func<TFirst, TKey> firstKeySelector,
Func<TSecond, TKey> secondKeySelector,
IEqualityComparer<TKey> comparer)
IEqualityComparer<TKey>? comparer)
=> MoreEnumerable.FullGroupJoin(first, second, firstKeySelector, secondKeySelector, comparer);

/// <summary>
Expand Down Expand Up @@ -2450,7 +2450,7 @@ public static IEnumerable<TResult> FullGroupJoin<TFirst, TSecond, TKey, TResult>
Func<TFirst, TKey> firstKeySelector,
Func<TSecond, TKey> secondKeySelector,
Func<TKey, IEnumerable<TFirst>, IEnumerable<TSecond>, TResult> resultSelector,
IEqualityComparer<TKey> comparer)
IEqualityComparer<TKey>? comparer)
=> MoreEnumerable.FullGroupJoin(first, second, firstKeySelector, secondKeySelector, resultSelector, comparer);

}
Expand Down
4 changes: 2 additions & 2 deletions MoreLinq/FullGroupJoin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static partial class MoreEnumerable
IEnumerable<TSecond> second,
Func<TFirst, TKey> firstKeySelector,
Func<TSecond, TKey> secondKeySelector,
IEqualityComparer<TKey> comparer)
IEqualityComparer<TKey>? comparer)
atifaziz marked this conversation as resolved.
Show resolved Hide resolved
{
return FullGroupJoin(first, second, firstKeySelector, secondKeySelector, ValueTuple.Create, comparer);
}
Expand Down Expand Up @@ -139,7 +139,7 @@ public static IEnumerable<TResult> FullGroupJoin<TFirst, TSecond, TKey, TResult>
Func<TFirst, TKey> firstKeySelector,
Func<TSecond, TKey> secondKeySelector,
Func<TKey, IEnumerable<TFirst>, IEnumerable<TSecond>, TResult> resultSelector,
IEqualityComparer<TKey> comparer)
IEqualityComparer<TKey>? comparer)
{
if (first == null) throw new ArgumentNullException(nameof(first));
if (second == null) throw new ArgumentNullException(nameof(second));
Expand Down