[swift-evolution] [Review] SE-0110: Distinguish between single-tuple and multiple-argument function types

Daniel Duan daniel at duan.org
Fri Jul 1 17:49:17 CDT 2016


Chris Lattner via swift-evolution <swift-evolution at ...> writes:

I think there's an edge case that needs consideration: when there's zero
expected arguments and the '_' parameter is used:

let f: () -> Void = { _ in }

According to the proposal, this is syntactically incorrect ( 0 != 1 ). But it
is legal now since '_' matches up with the empty tuple. Is there value to keep
it legal?

Either way, this may remain an implementation detail. But it might be
beneficial to make it explicit in the proposal.

- Daniel




More information about the swift-evolution mailing list