diff --git a/MoreLinq.Test/ZipLongestTest.cs b/MoreLinq.Test/ZipLongestTest.cs index f61470013..5b4e74789 100644 --- a/MoreLinq.Test/ZipLongestTest.cs +++ b/MoreLinq.Test/ZipLongestTest.cs @@ -15,6 +15,8 @@ // limitations under the License. #endregion +#nullable enable + namespace MoreLinq.Test { using System; @@ -31,13 +33,13 @@ public class ZipLongestTest public static readonly IEnumerable TestData = from e in new[] { - new { A = Seq( ), B = Seq("foo", "bar", "baz"), Result = Seq((0, "foo"), (0, "bar"), (0, "baz")) }, - new { A = Seq(1 ), B = Seq("foo", "bar", "baz"), Result = Seq((1, "foo"), (0, "bar"), (0, "baz")) }, - new { A = Seq(1, 2 ), B = Seq("foo", "bar", "baz"), Result = Seq((1, "foo"), (2, "bar"), (0, "baz")) }, - new { A = Seq(1, 2, 3), B = Seq( ), Result = Seq((1, null ), (2, null ), (3, (string) null)) }, - new { A = Seq(1, 2, 3), B = Seq("foo" ), Result = Seq((1, "foo"), (2, null ), (3, null )) }, - new { A = Seq(1, 2, 3), B = Seq("foo", "bar" ), Result = Seq((1, "foo"), (2, "bar"), (3, null )) }, - new { A = Seq(1, 2, 3), B = Seq("foo", "bar", "baz"), Result = Seq((1, "foo"), (2, "bar"), (3, "baz")) }, + new { A = Seq( ), B = Seq("foo", "bar", "baz"), Result = Seq<(int, string?)>((0, "foo"), (0, "bar"), (0, "baz")) }, + new { A = Seq(1 ), B = Seq("foo", "bar", "baz"), Result = Seq<(int, string?)>((1, "foo"), (0, "bar"), (0, "baz")) }, + new { A = Seq(1, 2 ), B = Seq("foo", "bar", "baz"), Result = Seq<(int, string?)>((1, "foo"), (2, "bar"), (0, "baz")) }, + new { A = Seq(1, 2, 3), B = Seq( ), Result = Seq<(int, string?)>((1, null ), (2, null ), (3, null )) }, + new { A = Seq(1, 2, 3), B = Seq("foo" ), Result = Seq<(int, string?)>((1, "foo"), (2, null ), (3, null )) }, + new { A = Seq(1, 2, 3), B = Seq("foo", "bar" ), Result = Seq<(int, string?)>((1, "foo"), (2, "bar"), (3, null )) }, + new { A = Seq(1, 2, 3), B = Seq("foo", "bar", "baz"), Result = Seq<(int, string?)>((1, "foo"), (2, "bar"), (3, "baz")) }, } select new TestCaseData(e.A, e.B) .Returns(e.Result); diff --git a/MoreLinq/Extensions.g.cs b/MoreLinq/Extensions.g.cs index 14d73e462..9e5b16a71 100644 --- a/MoreLinq/Extensions.g.cs +++ b/MoreLinq/Extensions.g.cs @@ -6837,7 +6837,7 @@ public static partial class ZipLongestExtension public static IEnumerable ZipLongest( this IEnumerable first, IEnumerable second, - Func resultSelector) + Func resultSelector) => MoreEnumerable.ZipLongest(first, second, resultSelector); /// @@ -6883,7 +6883,7 @@ public static IEnumerable ZipLongest( this IEnumerable first, IEnumerable second, IEnumerable third, - Func resultSelector) + Func resultSelector) => MoreEnumerable.ZipLongest(first, second, third, resultSelector); /// @@ -6933,7 +6933,7 @@ public static IEnumerable ZipLongest( IEnumerable second, IEnumerable third, IEnumerable fourth, - Func resultSelector) + Func resultSelector) => MoreEnumerable.ZipLongest(first, second, third, fourth, resultSelector); } diff --git a/MoreLinq/ZipLongest.cs b/MoreLinq/ZipLongest.cs index 5f93188d7..38e5fdefc 100644 --- a/MoreLinq/ZipLongest.cs +++ b/MoreLinq/ZipLongest.cs @@ -60,7 +60,7 @@ static partial class MoreEnumerable public static IEnumerable ZipLongest( this IEnumerable first, IEnumerable second, - Func resultSelector) + Func resultSelector) { if (first == null) throw new ArgumentNullException(nameof(first)); if (second == null) throw new ArgumentNullException(nameof(second)); @@ -112,7 +112,7 @@ public static IEnumerable ZipLongest( this IEnumerable first, IEnumerable second, IEnumerable third, - Func resultSelector) + Func resultSelector) { if (first == null) throw new ArgumentNullException(nameof(first)); if (second == null) throw new ArgumentNullException(nameof(second)); @@ -169,7 +169,7 @@ public static IEnumerable ZipLongest( IEnumerable second, IEnumerable third, IEnumerable fourth, - Func resultSelector) + Func resultSelector) { if (first == null) throw new ArgumentNullException(nameof(first)); if (second == null) throw new ArgumentNullException(nameof(second));