[swift-evolution] Argument labels in callbacks

Goffredo Marocchi panajev at gmail.com
Wed Feb 22 02:41:09 CST 2017

I am quite interested in this as well, thanks for bringing it up! It was quite disappointing to fall back to multi argument method calls without labels as it was going against the emphasis on the value of labels in the language as well as decreasing readability of what is supposed to be self documenting code.

Sent from my iPhone

> On 22 Feb 2017, at 08:36, Franklin Schrans via swift-evolution <swift-evolution at swift.org> wrote:
> Hi,
> When SE-0111 was approved, I noticed the implication it had when using closures as callbacks:
> Writing
>    func foo(completion: (success: Bool) -> Void) {
>      completion(success: true)
>    }
> is no longer possible, because function types can’t have argument labels anymore, and the function has to be written:
>    func foo(completion: (Bool) -> Void) {
>      completion(true)
>    }
> which doesn’t look very nice, especially as the number of the arguments increases.
> After talking to Chris Lattner about this, he referred me to this email.
> I was wondering if there's been any further work or plans in restoring the use of argument labels in closures.
> - Franklin
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170222/bbaddea0/attachment.html>

More information about the swift-evolution mailing list