[swift-evolution] [Discussion] Default Closure Arguments

Andrew Bennett cacoyi at gmail.com
Tue Jun 14 05:40:52 CDT 2016


I'd like to be able to do this:

func callSomething(callback: (test: (arg: Int = 4) -> Void) -> Void) {

  callback(test: { print($0) })

}


callSomething { test in

  test()

}



Ideally the default argument would be part of the closure's type signature.

If-not then it could be part of callSomething's signature, and it could
lose the defaulted arguments if passed around.

What do you think?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160614/ca51611e/attachment.html>


More information about the swift-evolution mailing list