[swift-evolution] [pitch] Eliminate the "T1 -> T2" syntax, require "(T1) -> T2"

davesweeris at mac.com davesweeris at mac.com
Fri Apr 15 16:14:59 CDT 2016

So, `Void->Int` functions would work like this?
let foo = bar(()) // returns Int

> On Apr 15, 2016, at 3:23 PM, Brent Royal-Gordon via swift-evolution <swift-evolution at swift.org> wrote:
> What I think we *should* eliminate, however, is using `Void` to mean "no arguments" in a closure type. `Void -> Int` should mean that the type takes one argument which happens to be an empty tuple. If you want no arguments, write `() -> Int`.

More information about the swift-evolution mailing list