I'm fine with it. And the author of the method has full control - if they want, they can call it
firstWhere instead - nothing in the language precludes it. My understanding is that Swift simply choses to, by convention, express method similarity more explicitly than merely a common string prefix, but with also with an explicit '(' terminator on that prefix.
There already has to be some way to disambiguate e.g.
first(after:) - the compiler can't implicitly refer to both as merely
first. Disambiguating consistently seems like a readability win to me (and lessens vulnerability to API changes).
(granted this hypothetical
first(after:) is fairly esoteric, but it's technically valid, functionally distinct, and cannot be disambiguated based on parameter type, which is
(T) -> Bool in both)
That all said, if the compiler could disambiguate based on the presence of the trailing closure - between a single-parameter
first(where:) and a zero-parameter
first - that'd be an interesting avenue. Though it seems like that could be ambiguous when used in an