Skip to content

Commit 0408456

Browse files
committed
Comment out assert to workaround codegen bug
1 parent 1a76e37 commit 0408456

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/CollectionsMarshal.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ public static Span<T> AsSpan<T>(List<T>? list)
3434
ThrowHelper.ThrowInvalidOperationException_ConcurrentOperationsNotSupported();
3535
}
3636

37-
Debug.Assert(typeof(T[]) == list._items.GetType(), "Implementation depends on List<T> always using a T[] and not U[] where U : T.");
37+
// Commented out to workaround https://github.com/dotnet/runtime/issues/96876
38+
// Debug.Assert(typeof(T[]) == list._items.GetType(), "Implementation depends on List<T> always using a T[] and not U[] where U : T.");
3839
span = new Span<T>(ref MemoryMarshal.GetArrayDataReference(items), size);
3940
}
4041

0 commit comments

Comments
 (0)