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

[6.0] Implement count(where:) method #72705

Merged
merged 1 commit into from
Apr 1, 2024
Merged

Conversation

natecook1000
Copy link
Member

@natecook1000 natecook1000 commented Mar 29, 2024

This is a cherry-pick of #70816, implementing the Sequence.count(where:) method as proposed in SE-0220.

Explanation: This changes implements the count(where:) extension method on the Sequence protocol.
Scope: This adds one new method as a protocol extension. It does not add any new ABI, as the method is marked AEIC, which is required due to its use of typed throws. (Note that unlike with the changes to existing stdlib methods to add typed throws, there's no prior ABI for this method, so the residual hidden overload isn't necessary.)
Issue: SE-0220
Original PR: #70816
Risk: Low. When this specific API was approved and added to the stdlib in Swift 5.0 time frame, it caused type checking performance regressions due to its name collision with Collection.count. We're confident that the type checker improvements since then will make this a non-issue.
Testing: The PR includes unit testing for behavior and error handling.
Reviewer: @stephentyrone

* Revert "Revert count(where:)"

This reverts commit 779ea19.

Now that SE-0220 has been re-accepted, this adds the `count(where:)` 
Sequence method to the standard library.
@natecook1000
Copy link
Member Author

@swift-ci Please test

@natecook1000 natecook1000 added 🍒 release cherry pick Flag: Release branch cherry picks swift 6.0 labels Mar 29, 2024
@stephentyrone
Copy link
Contributor

Needs to have the 6.0 PR template: https://forums.swift.org/t/swift-6-0-release-process/70220

@egorzhdan egorzhdan removed their request for review March 29, 2024 20:02
@ahoppen ahoppen removed their request for review March 29, 2024 22:01
@natecook1000 natecook1000 merged commit b35583d into release/6.0 Apr 1, 2024
5 checks passed
@natecook1000 natecook1000 deleted the swift6-count-where branch April 1, 2024 15:42
@al45tair al45tair removed their request for review April 3, 2024 16:27
@LePips LePips mentioned this pull request Oct 14, 2024
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants