-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Make IImmutableList covariant like IReadOnlyList, IEnumerable etc. #16011
Comments
I don't think it can reasonably be made covariant since the interface has contravariant methods |
Maybe it can be done if the covariant methods are moved to a new interface like IImmutableListBase that IImmutableList inherits from ? |
@bluemmc Almost all covariant methods are already on |
|
Thanks for all the feedback. You are both right. I will have to do with IReadOnlyList when I need it in covariant form (as I do in my example). |
I need System.Collections.Immutable interfaces such as IImmutableList to be covariant just like IReadOnlyList, IEnumerable in order to be able to write stuff like this:
The text was updated successfully, but these errors were encountered: