[swift-evolution] [swift-evolution-announce] [Review] SE-0111: Remove type system significance of function argument labels

Scott James Remnant scott at netsplit.com
Thu Jun 30 13:43:34 CDT 2016


-1

This proposal doesn’t even use Swift naming style to make its point, as soon as you do, the reason why Swift considers argument labels to be part of the type signature becomes apparent. 

The author of the proposal uses the following example:

  func doSomething(x: Int, y: Int) -> Bool


This is just not Swift-y, a much better example would be:

  func sinkBattleship(atX x: Int, y: Int) -> Bool

the proposal states that the argument labels be then stripped from the type, which would make this method type-compatible with:

  func meetsBattingAverage(ofHits hits: Int, forRuns runs: Int) -> Bool


I don’t think it’s desirable for this to work at all… Argument labels are not parameter names, they are a first class part of Swift’s type system, and always meaningful when employed properly.


Scott


More information about the swift-evolution mailing list