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

Align API surface of immutable collections and their corresponding builder types #66550

Merged
merged 14 commits into from
May 4, 2022

Conversation

RaymondHuy
Copy link
Contributor

Resolve #822

@dotnet-issue-labeler
Copy link

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Mar 13, 2022
@ghost
Copy link

ghost commented Mar 13, 2022

Tagging subscribers to this area: @dotnet/area-system-collections
See info in area-owners.md if you want to be subscribed.

Issue Details

Resolve #822

Author: RaymondHuy
Assignees: -
Labels:

area-System.Collections, new-api-needs-documentation, community-contribution

Milestone: -

@RaymondHuy
Copy link
Contributor Author

Hi @eiriktsarpalis Could you take a look on this PR ? 😃

@eiriktsarpalis
Copy link
Member

@RaymondHuy I'm backlogged at the moment, will follow up with reviewing later. Thanks.

Copy link
Member

@eiriktsarpalis eiriktsarpalis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor feedback concerning implementation and XML documentation. CI also seems to be failing because of parameter mismatches between reference source and implementation.

@ghost ghost added the needs-author-action An issue or pull request that requires more info or actions from the author. label Apr 21, 2022
@@ -702,8 +720,14 @@ public sealed partial class Builder : System.Collections.Generic.ICollection<T>,
public int LastIndexOf(T item, int startIndex, int count) { throw null; }
public int LastIndexOf(T item, int startIndex, int count, System.Collections.Generic.IEqualityComparer<T>? equalityComparer) { throw null; }
public bool Remove(T item) { throw null; }
public void Remove(T value, IEqualityComparer<T>? equalityComparer) { throw null; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the above, cc @terrajobst

Suggested change
public void Remove(T value, IEqualityComparer<T>? equalityComparer) { throw null; }
public bool Remove(T item, IEqualityComparer<T>? equalityComparer) { throw null; }

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RaymondHuy could you please update the return type? It should match that of the existing overload.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @eiriktsarpalis I have updated the PR.

@ghost ghost removed the needs-author-action An issue or pull request that requires more info or actions from the author. label Apr 30, 2022
@@ -486,14 +487,17 @@ public bool Remove(T element)
/// The equality comparer to use in the search.
/// If <c>null</c>, <see cref="EqualityComparer{T}.Default"/> is used.
/// </param>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a <returns /> element as above.

@@ -463,6 +463,7 @@ public void AddRange(Builder items)

/// <summary>
/// Removes the first occurrence of the specified element from the builder.
/// If no match is found, the builder remains unchanged.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're adding this, shouldn't it be included in the new overload as well?

Copy link
Member

@eiriktsarpalis eiriktsarpalis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@eiriktsarpalis eiriktsarpalis merged commit 4a3bd26 into dotnet:main May 4, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jun 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Collections community-contribution Indicates that the PR has been added by a community member new-api-needs-documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Align API surface of immutable collections and their corresponding builder types
3 participants