> On Jul 3, 2016, at 5:02, Vladimir.S via swift-evolution 
> <[email protected]> wrote:
> 
> On 02.07.2016 4:20, Daniel Duan via swift-evolution wrote:
>>> Vladimir.S via swift-evolution <swift-evolution@...> writes:
>> 
>> Following your conclusion, should this be legal as well?
>> 
>> let f: () -> Void = { x in print(x) } // f() prints "()"
>> let f: (Int) -> Void = { x in print(x) } // f(5) prints "5"
>> 
>> In other words, "0 argument" is an impossible scenario?
> 
> I don't see problems here. ()->Void means (Void)->Void, there *is* one 
> parameter of Void type, which we can omitted as it is empty tuple. So, if you 
> want you can write f(()) or or let z = (); f(z); or just f(), so in closure 
> definition you can have one argument or can have 0 defined arguments if the 
> only argument is of type Void.

I already said this on the bug you filed, but I disagree quite strongly with 
this interpretation, based on SE-0029 
<https://github.com/apple/swift-evolution/blob/master/proposals/0029-remove-implicit-tuple-splat.md>SE-002
 
<https://github.com/apple/swift-evolution/blob/master/proposals/0029-remove-implicit-tuple-splat.md>9.
 IMO, going from (()) to () is a form of tuple splat.

Jordan
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to