-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Allow collection expressions for 'System.Collections.ObjectModel' collection types #111093
Open
AlexRadch
wants to merge
12
commits into
dotnet:main
Choose a base branch
from
AlexRadch:CollectionExpressionsForObjectModelCollections
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Allow collection expressions for 'System.Collections.ObjectModel' collection types #111093
AlexRadch
wants to merge
12
commits into
dotnet:main
from
AlexRadch:CollectionExpressionsForObjectModelCollections
+87
−0
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…jectModel' collection types dotnet#110161
Note regarding the
|
1 similar comment
Note regarding the
|
dotnet-policy-service
bot
added
the
community-contribution
Indicates that the PR has been added by a community member
label
Jan 5, 2025
huoyaoyuan
reviewed
Jan 5, 2025
src/libraries/System.Private.CoreLib/src/System/Collections/ObjectModel/ReadOnlyCollection.cs
Outdated
Show resolved
Hide resolved
stephentoub
reviewed
Jan 5, 2025
src/libraries/System.Private.CoreLib/src/System/Collections/ObjectModel/ReadOnlyCollection.cs
Outdated
Show resolved
Hide resolved
stephentoub
reviewed
Jan 5, 2025
src/libraries/System.Private.CoreLib/src/System/Collections/ObjectModel/ReadOnlyCollection.cs
Outdated
Show resolved
Hide resolved
stephentoub
reviewed
Jan 5, 2025
src/libraries/System.Private.CoreLib/src/System/Collections/ObjectModel/ReadOnlyCollection.cs
Outdated
Show resolved
Hide resolved
stephentoub
reviewed
Jan 5, 2025
src/libraries/System.Private.CoreLib/src/System/Collections/ObjectModel/ReadOnlyCollection.cs
Show resolved
Hide resolved
Enhance ReadOnlyCollection with documentation and updates The `EditorBrowsable` attribute is replaced with a `SuppressMessage` attribute to clarify the intended usage of these methods. Additionally, the condition for checking if input values are empty is updated from `values.Length <= 0` to `values.IsEmpty` for improved readability and performance.
Eliminated the `using System.ComponentModel;` directive, reducing dependencies and potentially simplifying the code structure.
This was referenced Jan 6, 2025
src/libraries/System.Private.CoreLib/src/System/Collections/ObjectModel/ReadOnlyCollection.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Collections/ObjectModel/ReadOnlyCollection.cs
Outdated
Show resolved
Hide resolved
The `CreateCollection<T>` method in the `ReadOnlyCollection` class had its suppression attribute removed, addressing a style warning related to collection initialization while maintaining its functionality. Similarly, the `CreateSet<T>` method in the `ReadOnlySet` class also had its suppression attribute removed, preserving its original functionality.
mphelt
reviewed
Jan 7, 2025
src/libraries/System.Private.CoreLib/src/System/Collections/ObjectModel/ReadOnlyCollection.cs
Outdated
Show resolved
Hide resolved
Sergio0694
reviewed
Jan 7, 2025
This was referenced Jan 7, 2025
Open
…ith the `[EditorBrowsable(EditorBrowsableState.Never)]` attribute to hide them from IntelliSense.
src/libraries/System.Private.CoreLib/src/System/Collections/ObjectModel/ReadOnlyCollection.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Collections/ObjectModel/ReadOnlyCollection.cs
Outdated
Show resolved
Hide resolved
eiriktsarpalis
approved these changes
Jan 8, 2025
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!
3 tasks
Updated method names in ReadOnlyCollection and ReadOnlySet from CreateCollection and CreateSet to Create for clarity and consistency. Removed the CreateSet method from ReadOnlyCollection to streamline functionality. Adjusted documentation comments for improved clarity. Updated CollectionBuilder attributes to reflect the new method names, ensuring proper linkage for collection creation.
…instead of `ReadOnlyCollection`, reflecting a change in the collection type used in the `ReadOnlySet` class.
Updated `ReadOnlyCollection` to rename `Create` to `CreateCollection` and introduced `CreateSet` for creating `ReadOnlySet` instances from spans. Adjusted `CollectionBuilder` attributes accordingly and removed the static `ReadOnlySet` class, integrating its functionality into the main class. Updated the `ReadOnlyCollection` partial class in `System.Runtime.cs` to maintain API consistency.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area-System.Collections
community-contribution
Indicates that the PR has been added by a community member
new-api-needs-documentation
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Close #110161