diff --git a/src/TestFramework/TestFramework/Assertions/Assert.Count.cs b/src/TestFramework/TestFramework/Assertions/Assert.Count.cs index 0261c40212..10066e3112 100644 --- a/src/TestFramework/TestFramework/Assertions/Assert.Count.cs +++ b/src/TestFramework/TestFramework/Assertions/Assert.Count.cs @@ -587,7 +587,7 @@ public static void HasCount(int expected, Memory collection, [Interpolated /// Users shouldn't pass a value for this parameter. /// public static void HasCount(int expected, Memory collection, string? message = "", [CallerArgumentExpression(nameof(collection))] string collectionExpression = "") - => HasCount(nameof(HasCount), expected, ((ReadOnlyMemory)collection).Span, message, collectionExpression); + => HasCount(nameof(HasCount), expected, collection.Span, message, collectionExpression); #endif