<div dir="ltr">+1 if SE-0111 is accepted. 0 otherwise. </div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 1, 2016 at 7:34 PM, Vladimir.S via swift-evolution <span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 02.07.2016 1:49, Daniel Duan via swift-evolution wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Chris Lattner via swift-evolution &lt;swift-evolution@...&gt; writes:<br>
<br>
I think there&#39;s an edge case that needs consideration: when there&#39;s zero<br>
expected arguments and the &#39;_&#39; parameter is used:<br>
<br>
let f: () -&gt; Void = { _ in }<br>
</blockquote>
<br></span>
As I understand current syntax and logic, there is *one* expected argument : Void. This is why we can call f(()). But we are allowed to omit that empty tuple parameter in syntax(on caller side and in function parameter list definition). So, IMO or this should be leaved as is, or we should move away from association between Void and &quot;emptiness&quot; of parameters(I don&#39;t understand if this is possible).<br>
<br>
If we&#39;ll disallow this, will that be allowed:<br>
<br>
func foo(_ x: Void) { print(x) }<br>
<br>
foo()<br>
<br>
and then question regarding<br>
<br>
typealias MyFunc&lt;T&gt; = (T) -&gt; Void<br>
<br>
let myfunc1 : MyFunc&lt;Int&gt; = {i in print(i)}<br>
let myfunc2 : MyFunc&lt;String&gt; = {s in print(s)}<br>
let myfunc3 : MyFunc&lt;Void&gt; = {_ in print(&quot;nothing&quot;)}<br>
<br>
<br>
Probably there is no problem with current behavior for empty tuple(Void) as soon as *one* parameter will be mapped to the same *one* argument(or zero arguments for this very special case).<br>
<br>
Btw, don&#39;t we want to stop these games with recursive empty tuples:<br>
<br>
foo(())<br>
foo(((())))<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
According to the proposal, this is syntactically incorrect ( 0 != 1 ). But it<br>
is legal now since &#39;_&#39; matches up with the empty tuple. Is there value to keep<br>
it legal?<br>
<br>
Either way, this may remain an implementation detail. But it might be<br>
beneficial to make it explicit in the proposal.<br>
<br>
- Daniel<br>
<br>
<br>
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
<br>
</blockquote>
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</div></div></blockquote></div><br></div>