<div dir="ltr">On Mon, May 8, 2017 at 12:16 AM, David Hart <span dir="ltr"><<a href="mailto:david@hartbit.com" target="_blank">david@hartbit.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><span class=""><div><br></div><div>On 7 May 2017, at 00:21, Xiaodi Wu via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:<br><br></div><blockquote type="cite"><div>To which human would it be misleading?<br><br>To the writer? No, because the compiler will warn you right away. By the time you're done with writing the first line, it'll warn you that Int and Double are unused variables. And if you try to use x and y, you get an error.<br><br>To the reader? Only if the writer knowingly wrote this misleading code. In other words, it's a nice puzzle, but no reader will encounter this in real-world code, unless they're being tormented by the writer on purpose.<br></div></blockquote><div><br></div></span><div>IMHO, the fact that the compiler warns you does no change the fact that it's a very confusing part of the language. It should not be an excuse for fixing it. Consistency teaches us to expect a type after a colon.</div></div></blockquote></div><br></div><div class="gmail_extra">Highly disagree. Consistency teaches us that variables can come after a colon.</div><div class="gmail_extra"><br></div><div class="gmail_extra">```</div><div class="gmail_extra">func foo(bar: Int, baz: Int) {</div><div class="gmail_extra"> print(bar, baz)</div><div class="gmail_extra">}</div><div class="gmail_extra"><br></div><div class="gmail_extra">func foo(bar: Bool, baz: Bool) {</div><div class="gmail_extra"> print(bar, baz)</div><div class="gmail_extra">}</div><div class="gmail_extra"><br></div><div class="gmail_extra">let x = 42</div><div class="gmail_extra">let y = 43</div><div class="gmail_extra">foo(bar: x, baz: y)</div><div class="gmail_extra">// x and y are variables, and they come after the colon.</div><div class="gmail_extra">// We don't allow users to write `foo(bar x: Int, baz y: Int)`,</div><div class="gmail_extra">// even when there are overloads.</div><div class="gmail_extra">```</div><div class="gmail_extra"><br></div><div class="gmail_extra">There is nothing inconsistent about this part of the language.</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div></div>