Skip to content

Commit fb8c77f

Browse files
stephentoubjkotas
andauthored
Comment out assert to workaround codegen bug (#96877)
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
1 parent 3e2bc17 commit fb8c77f

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

+2-1
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)