SE-0220: count(where:) has been accepted .
Feedback on the proposal was extremely positive, and the proposal was accepted without modifications. Thank you to everyone who participated in the review!
-Chris
8 Likes
rudedogg
(Austin Rude)
2
What happened with count(where:)? I'm confused because the implementation was merged in September 2018, but I can't seem to find it in the Swift changelog.md, or in Xcode.
What Xcode are you using?
owenv
(Owen Voorhees)
4
2 Likes
rudedogg
(Austin Rude)
5
That's too bad! Thanks for the details. I know it probably won't fly, but I'd be okay with elementCount(where:) to fix the type checker ambiguity 
More seriously, I wonder if this would still be an issue with Swift 5.1? I thought I heard some type checker changes had to (or are currently) being made to handle SwiftUI.
@John_McCall Xcode 11/Swift 5.1 FWIW
@rudedogg here a follow up thread that tries to solve the issue which blocked the accepted proposal:
2 Likes
AlexanderM
(Alexander Momchilov)
7
I imagine a lot of uses for this would have the pattern
someCollection.count(where: someCondition) == someConstant
Is that something the compiler could be clever about, and add short-circuiting (i.e. no need to keep going, if you've already surpassed a count of someConstant?
prathameshk
(Prathamesh Kowarkar)
9
Was the option to rename the method to filteredCount(where:) considered? If yes, why did wasn't that option accepted?
BigZaphod
(Sean Heber)
10
I would suggest the name countEach(where:) as a compromise.
scanon
(Steve Canon)
11
Many renamings are possible, but ideally we'll just fix the type checker issue =)
15 Likes