From fd126fc21050abafbcda03415c998837adbe2e21 Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Fri, 12 Jan 2024 14:16:45 -0800 Subject: [PATCH] Update CollectionsMarshal.cs --- .../src/System/Runtime/InteropServices/CollectionsMarshal.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/CollectionsMarshal.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/CollectionsMarshal.cs index e3cecd684abf6..d27f7ba75aeb2 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/CollectionsMarshal.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/CollectionsMarshal.cs @@ -34,7 +34,7 @@ public static Span AsSpan(List? list) ThrowHelper.ThrowInvalidOperationException_ConcurrentOperationsNotSupported(); } - Debug.Assert(typeof(T[]) == list._items.GetType(), "Implementation depends on List always using a T[] and not U[] where U : T."); + Debug.Assert(typeof(T[]) == list._items.GetType(), $"Implementation depends on List always using a T[] and not U[] where U : T. {typeof(T[])} != {list._items.GetType()}"); span = new Span(ref MemoryMarshal.GetArrayDataReference(items), size); }