SE-0220 has been accepted, but not yet implemented in Swift 5.
In fact an initial implementation had to be reverted due to problems with the type checker. For more information, see Require parameter names when referencing to functions in the Swift forum:
Some of you may remember SE-0220, my proposal that added the
count(where:) function to sequences. This proposal was ultimately
accepted in time for Swift 5, but sadly had to be reverted because
it was causing issues with the type checker.
The issue was that when you reference count, in an expression like
myArray.count * 5
, you could be referring to the count
property, with
type Int
, or the count(where:)
function, which has type
((Element) -> Bool) -> Int
, which you can refer to in shorthand as count. When Swift
tries to resolve what version of the *
function to use, it has to run
through a lot more potential implementations, which explode
combinatorially as you increase the number of operators in the
expression.