When a function\'s return value is another function,there\'s no way to get the returned function\'s argument names.Is this a pitfall of swift language?
For example:<
You're correct. From the Swift 3 release notes:
Argument labels have been removed from Swift function types... Unapplied references to functions or initializers no longer carry argument labels.
Thus, the type of townPlan
, i.e. the type returned from calling makeTownGrand
, is (Int,Int) -> Int
— and carries no external argument label information.
For a full discussion of the rationale, see https://github.com/apple/swift-evolution/blob/545e7bea606f87a7ff4decf656954b0219e037d3/proposals/0111-remove-arg-label-type-significance.md