-
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
Added AsReadOnly() extension to ISet<T> #106037
base: main
Are you sure you want to change the base?
Conversation
Note regarding the
|
1 similar comment
Note regarding the
|
Yes, the implementation of |
Unfortunately I still get the following error:
|
This is editing the wrong System.Private.CoreLib project file. You instead want to add it to https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems. CoreLib for coreclr, mono, and native aot is slightly different for each. Most of the source is the same, and that shared source is listed in the above projitems file. The file you edited is the one that contains just the additional source specific to coreclr. |
74d8a2c
to
d6050da
Compare
@stephentoub @artl93 can we make an exception and slot this API into .NET 9? It's low risk and complements the newly introduced |
src/libraries/System.Collections/tests/Generic/CollectionExtensionsTests.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
Sorry if I'm misunderstanding this, but if the type is moved from |
@stephentoub Is there something missing that is holding this back? |
This looks ready to merge. I've updated the PR branch to give this another run with more recent bits. |
I believe it will need to updated with type forwards, as suggested in #106037 (comment). |
this adds the asReadOnly extension method to ISet
unfortunately CollectionExtensions does not find ReadOnlySet, I guess it either has to be moved to System.Private.CoreLib and/or type forwarders have to be added. But I don't know how to do that.
fixes #29387