This was decided in SE-0111, Remove type system significance of function argument labels, which cites the following motivation:
Motivation
...
As currently implemented, this feature can lead to surprising behavior:
func sinkBattleship(atX x: Int, y: Int) -> Bool { /* ... */ } func meetsBattingAverage(ofHits hits: Int, forRuns runs: Int) -> Bool { /* ... */ } var battingAveragePredicate : (ofHits: Int, forRuns: Int) -> Bool = meetsBattingAverage battingAveragePredicate = sinkBattleship // sinkBattleship is invoked battingAveragePredicate(ofHits: 1, forRuns: 2)
Removing this feature simplifies the type system.
In other words, the argument labels were in a strange limbo, where they were significant enough to impact the inferred type of variables (e.g. battingAveragePredicate infers as (ofHits: Int, forRuns: Int) -> Bool), but were also loose enough that sinkBattleship could be assigned, despite having different argument labels.
The result is a call where the labels are (ofHits: 1, forRuns: 2), but actually behave as a call to (atX: 1, y: 2). This was confusing, and just got torn out entirely.
foo(_:_:)andbar(_:param:)both take 2 params and might have the same type. Closures do not have a name, they are anonymous functions. You cannot declare a variable with labels (e.g.let myClosure(x:y:) = {...}. Parameter labels get erased when using a function or closure as a value. This changed in Swift 3, see github.com/swiftlang/swift-evolution/blob/main/proposals/…