<div dir="ltr">Well, unless I&#39;m mistaken, `()` here is a value. I can replace it with `3` and the compiler emits a warning about unused results. I&#39;m guessing that since () is a value of type Void, the warning about unused results isn&#39;t triggered.<div>While it&#39;s true that `Void` causes an error, I can write `Void()` instead and everything compiles just fine, which is what the `()` is doing too. Seems fine to me?<div><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 11, 2016 at 1:43 PM, Erica Sadun 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"><div style="word-wrap:break-word">I thought this was long gone but today I found out it is still legal:<div><br></div><div><div style="margin:0px;font-size:16px;line-height:normal;font-family:Menlo;color:rgb(186,45,162)"><span style="font-variant-ligatures:no-common-ligatures">switch</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#4f8187">i</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000"> {</span></div><div style="margin:0px;font-size:16px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures;color:#ba2da2">case</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#272ad8">4</span><span style="font-variant-ligatures:no-common-ligatures"> ... </span><span style="font-variant-ligatures:no-common-ligatures;color:#272ad8">6</span><span style="font-variant-ligatures:no-common-ligatures">: ()</span></div><div style="margin:0px;font-size:16px;line-height:normal;font-family:Menlo;color:rgb(209,47,27)"><span style="font-variant-ligatures:no-common-ligatures;color:#ba2da2">case</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#272ad8">3</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000">: </span><span style="font-variant-ligatures:no-common-ligatures;color:#3e1e81">print</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000">(</span><span style="font-variant-ligatures:no-common-ligatures">&quot;Here&quot;</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000">)</span></div><div style="margin:0px;font-size:16px;line-height:normal;font-family:Menlo;color:rgb(186,45,162)"><span style="font-variant-ligatures:no-common-ligatures">default</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000">: </span><span style="font-variant-ligatures:no-common-ligatures">break</span></div><div style="margin:0px;font-size:16px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">}</span></div><div><br></div><div>Is there a motivating factor for keeping this in the language? The compiler picks up on Void and emits an error. You&#39;d think () would produce the same results but it doesn&#39;t.</div></div><span class="HOEnZb"><font color="#888888"><div><br></div><div>-- Erica</div><div><br></div></font></span></div><br>______________________________<wbr>_________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a><br>
<br></blockquote></div><br></div></div></div></div></div>