Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.Collections.Specialized collections should implement generic collection interfaces #13964

Closed
justinvp opened this issue Jan 8, 2015 · 2 comments
Labels
api-needs-work API needs work before it is approved, it is NOT ready for implementation
Milestone

Comments

@justinvp
Copy link
Contributor

justinvp commented Jan 8, 2015

Along the lines of #13933, some of the specialized collections should implement the generic collection interfaces...

I'll update this description with a more detailed proposal speclet, and would be happy to contribute a PR.

@sharwell
Copy link
Member

sharwell commented Jan 8, 2015

This request took at least an hour longer than I expected before it showed up 😉

@justinvp
Copy link
Contributor Author

I'm going to close this based on @davkean's comments in dotnet/corefx#370:

However, these collections, along with System.Collections.NonGeneric are entirely there for backwards compatibility - we don't want to invest in them, we don't want to add features to them. There are better and more appropriate replacements for them. Adding features, including generic interfaces, makes them more attractive to use, which is entirely not want we want and on top of that, hiding these public properties/methods, can only break code that was using them (whether correctly, or incorrectly) that ports to .NET Core.

This also applies to implementing generic interfaces, we know for a fact that this will break serialization on .NET Framework - we recently rolled back our implementation of IDictionary<TKey, TValue> on StringDictionary due to this.

To summarize, I believe that these should be ported as is, warts and all, to .NET Core with very little changes, solely for source compatibility. Let's spend the investment elsewhere, on the libraries and types that we want to invest and bring forward.

Note that implementing the generic interfaces on some of these specialized collections is trivial (see justinvp/corefx@77ab2c1 for StringCollection), but it's less trivial on others. If these are only meant to be used for backwards compatibility purposes, then there's no point in further investment, especially if it would make them more attractive to use when other more appropriate types are preferable.

Olafski referenced this issue in Olafski/corefx Jun 15, 2017
lewurm referenced this issue in lewurm/corefx Nov 4, 2019
Put fchmod back to the top in SystemNative_CopyFile and only ignore when it fails on android
@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 1.0.0-rtm milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Jan 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api-needs-work API needs work before it is approved, it is NOT ready for implementation
Projects
None yet
Development

No branches or pull requests

4 participants