From 6d8a6c25768eab0fda32365e10812ef4ca68ff39 Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Fri, 1 Jul 2022 15:10:51 -0400 Subject: [PATCH] Fix nullable annotations on new Order{Descending} methods (#71542) --- src/libraries/System.Linq/ref/System.Linq.cs | 4 ++-- src/libraries/System.Linq/src/System/Linq/OrderBy.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libraries/System.Linq/ref/System.Linq.cs b/src/libraries/System.Linq/ref/System.Linq.cs index 215ec4b4d34e8..a35e99ba3c232 100644 --- a/src/libraries/System.Linq/ref/System.Linq.cs +++ b/src/libraries/System.Linq/ref/System.Linq.cs @@ -148,9 +148,9 @@ public static System.Collections.Generic.IEnumerable< public static System.Linq.IOrderedEnumerable OrderBy(this System.Collections.Generic.IEnumerable source, System.Func keySelector) { throw null; } public static System.Linq.IOrderedEnumerable OrderBy(this System.Collections.Generic.IEnumerable source, System.Func keySelector, System.Collections.Generic.IComparer? comparer) { throw null; } public static System.Linq.IOrderedEnumerable OrderDescending(this System.Collections.Generic.IEnumerable source) { throw null; } - public static System.Linq.IOrderedEnumerable OrderDescending(this System.Collections.Generic.IEnumerable source, System.Collections.Generic.IComparer comparer) { throw null; } + public static System.Linq.IOrderedEnumerable OrderDescending(this System.Collections.Generic.IEnumerable source, System.Collections.Generic.IComparer? comparer) { throw null; } public static System.Linq.IOrderedEnumerable Order(this System.Collections.Generic.IEnumerable source) { throw null; } - public static System.Linq.IOrderedEnumerable Order(this System.Collections.Generic.IEnumerable source, System.Collections.Generic.IComparer comparer) { throw null; } + public static System.Linq.IOrderedEnumerable Order(this System.Collections.Generic.IEnumerable source, System.Collections.Generic.IComparer? comparer) { throw null; } public static System.Collections.Generic.IEnumerable Prepend(this System.Collections.Generic.IEnumerable source, TSource element) { throw null; } public static System.Collections.Generic.IEnumerable Range(int start, int count) { throw null; } public static System.Collections.Generic.IEnumerable Repeat(TResult element, int count) { throw null; } diff --git a/src/libraries/System.Linq/src/System/Linq/OrderBy.cs b/src/libraries/System.Linq/src/System/Linq/OrderBy.cs index c0bddf796f2b0..8d4734225b1a9 100644 --- a/src/libraries/System.Linq/src/System/Linq/OrderBy.cs +++ b/src/libraries/System.Linq/src/System/Linq/OrderBy.cs @@ -41,7 +41,7 @@ public static IOrderedEnumerable Order(this IEnumerable source) => /// /// If comparer is , the default comparer is used to compare elements. /// - public static IOrderedEnumerable Order(this IEnumerable source, IComparer comparer) => + public static IOrderedEnumerable Order(this IEnumerable source, IComparer? comparer) => OrderBy(source, static element => element, comparer); public static IOrderedEnumerable OrderBy(this IEnumerable source, Func keySelector) @@ -84,7 +84,7 @@ public static IOrderedEnumerable OrderDescending(this IEnumerable sourc /// /// If comparer is , the default comparer is used to compare elements. /// - public static IOrderedEnumerable OrderDescending(this IEnumerable source, IComparer comparer) => + public static IOrderedEnumerable OrderDescending(this IEnumerable source, IComparer? comparer) => OrderByDescending(source, static element => element, comparer); public static IOrderedEnumerable OrderByDescending(this IEnumerable source, Func keySelector) =>