The following code doesn't compile in any recent toolchain, due to issue with renamification and the rules for Swift default parameters:
Basically it is now unnecessarily difficult to call NSArray indexesOfObjects. The reason is that Swift sees the passingTest: parameter as ambiguous. Now, you might say: huh? Ambiguous with what? Well, it's rather subtle. Here's the detailed complaint from the compiler:
The nameless parameter in the second method has a default value, and both methods have a `passingTest` parameter, so in the absence of further information, our code could now be calling either of them.
This analysis suggests (rightly) that we can worm our way out of the difficulty by saying:
Yecch! What is the point of having an optional parameter (a parameter with a default value) if you have to supply it anyway? How did we get ourselves into this mess in the first place?
The answer is that Objective-C has two perfectly separate methods:
A moment's thought will reveal that Swift renamification has conflated these two methods into one. It is therefore impossible to call indexesOfObjectsPassingTest — it is effectively stricken from the field. Only indexesOfObjectsWithOptions can be called.
This could easily be resolved by giving the options parameter an explicit label. We would then have indexesOfObjects(options:... ) and indexesOfObjects(passingTest:... ) and all would be well.