diff --git a/MoreLinq.Test/FlattenTest.cs b/MoreLinq.Test/FlattenTest.cs index f3b5b4a6c..84b9c0a93 100644 --- a/MoreLinq.Test/FlattenTest.cs +++ b/MoreLinq.Test/FlattenTest.cs @@ -15,6 +15,8 @@ // limitations under the License. #endregion +#nullable enable + namespace MoreLinq.Test { using System.Collections.Generic; @@ -395,7 +397,7 @@ public void FlattenSelectorWithTree() var result = new[] { source }.Flatten(obj => obj switch { int => null, - Tree tree => new object[] { tree.Left, tree.Value, tree.Right }, + Tree tree => new object?[] { tree.Left, tree.Value, tree.Right }, IEnumerable inner => inner, _ => Enumerable.Empty() }); @@ -407,23 +409,23 @@ public void FlattenSelectorWithTree() class Series { - public string Name; - public Attribute[] Attributes; + public required string Name; + public required Attribute[] Attributes; } class Attribute { - public int[] Values; + public required int[] Values; } class Tree { public readonly T Value; - public readonly Tree Left; - public readonly Tree Right; + public readonly Tree? Left; + public readonly Tree? Right; public Tree(T value) : this(null, value, null) {} - public Tree(Tree left, T value, Tree right) + public Tree(Tree? left, T value, Tree? right) { Left = left; Value = value; diff --git a/MoreLinq.Test/MoreLinq.Test.csproj b/MoreLinq.Test/MoreLinq.Test.csproj index 470cfcab3..273866c9b 100644 --- a/MoreLinq.Test/MoreLinq.Test.csproj +++ b/MoreLinq.Test/MoreLinq.Test.csproj @@ -35,6 +35,7 @@ +