Task: Remove System.Collections.Generic.ReadOnlyCollection<T> as a base class of ReadOnlyList<T> #111
Labels
is:enhancement
New feature or request
pri:normal
up for grabs
This issue is open to be worked on by anyone
Milestone
The
J2N.ReadOnlyList<T>
subclassesSystem.Collections.Generic.ReadOnlyCollection<T>
.System.Collections.Generic.ReadOnlyCollection<T>.GetEnumerator()
has changed in behavior in .NET 8 (or possibly .NET 7) so that it returns an enumerator that throws when it is empty. This means we have different behavior between .NET 8 and older targets. We had to addFEATURE_READONLYCOLLECTION_ENUMERATOR_EMPTY_CURRENT_UNDEFINEDOPERATION_DOESNOTTHROW
as a workaround, since removing the subclass is a breaking change that requires a major version bump.So, the task is to copy the contents of
System.Collections.Generic.ReadOnlyCollection<T>
to ourReadOnlyList<T>
class (not sure why Microsoft screwed up the name, it acceptsIList<T>
rather thanICollection<T>
through the constructor), remove theSystem.Collections.Generic.ReadOnlyCollection<T>
base class, and remove theFEATURE_READONLYCOLLECTION_ENUMERATOR_EMPTY_CURRENT_UNDEFINEDOPERATION_DOESNOTTHROW
so all of our tests are consistent.The text was updated successfully, but these errors were encountered: