Skip to content

Commit

Permalink
Comment out assert to workaround codegen bug (#96877)
Browse files Browse the repository at this point in the history
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
  • Loading branch information
stephentoub and jkotas authored Jan 13, 2024
1 parent 3e2bc17 commit fb8c77f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ public static Span<T> AsSpan<T>(List<T>? list)
ThrowHelper.ThrowInvalidOperationException_ConcurrentOperationsNotSupported();
}

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

Expand Down

0 comments on commit fb8c77f

Please sign in to comment.