<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I don’t agree with your assertions that this makes Swift “less safe” - if anything the bug that this fixed was anything but. &nbsp;When performing a pattern match, we expect the pattern to match the “shape” of the declaration itself. &nbsp;If ‘()’ was not part of that declaration, then you have no reason to indicate this as part of a pattern. &nbsp;Consider a slightly more extreme case that was allowed before we fixed this bug (and, for compatibility reasons, is still allowed in Swift 3 mode)<div class=""><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(186, 45, 162); background-color: rgb(255, 255, 255);" class="">enum<span style="color: #000000" class=""> E {</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">&nbsp; <span style="color: #ba2da2" class="">case</span> A, B, C, D</div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">}</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="color: #ba2da2" class="">func</span> testE(e: <span style="color: #4f8187" class="">E</span>) {</div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(186, 45, 162); background-color: rgb(255, 255, 255);" class=""><span style="color: #000000" class="">&nbsp; </span>switch<span style="color: #000000" class=""> e {</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">&nbsp; <span style="color: #ba2da2" class="">case</span> .<span style="color: #31595d" class="">A</span>(<span style="color: #ba2da2" class="">let</span> x): <span style="color: #3e1e81" class="">print</span>(x)</div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(186, 45, 162); background-color: rgb(255, 255, 255);" class=""><span style="color: #000000" class="">&nbsp; </span>default<span style="color: #000000" class="">: </span>break</div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">&nbsp; }</div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">}</div><div class=""><br class=""></div><div class="">Assuming this survives SILGen, which it often doesn’t, what do you feel a reasonable value for “x” should be? &nbsp;Our compiler thinks (thought?) ‘<font face="Menlo" class="">Void</font>’.</div><div class=""><br class=""></div><div class="">~Robert Widmann</div><div class=""><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jul 28, 2017, at 2:23 PM, Amir Michail via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">The latest beta doesn’t allow you to append “()” to an enum name with no associated value in a switch case.<br class=""><br class="">This makes Swift less safe because appending that “()” is an excellent way to indicate that you are not ignoring the associated value in the swift case because there isn’t any.<br class=""><br class="">Suppose that you later add an associated value. Then the switch case with the “()” will give a compile error, which is better than silently introducing a bug into your code.<br class=""><br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></div></blockquote></div><br class=""></div></div></div></div></body></html>