Replacing default with case _ is a commonly rejected proposal, and I do believe it&#39;s been discussed since the lowercasing of enum cases.<br><br><div class="gmail_quote"><div dir="ltr">On Fri, Jun 17, 2016 at 15:55 Tony Allevato via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Agreed, it sounds like default should be treated as a contextual keyword in this case.<div><br></div><div>It never even occurred to me that &quot;case _:&quot; would work as a replacement for default, but it does even today—and now that I&#39;ve seen it, it makes total sense. I could definitely get behind a proposal to remove &quot;default&quot; as a keyword from the language entirely in favor of that. It blends well with other pattern matching. The only concern I would have would be about discoverability, but it would be easy to have the compiler emit an error when it sees default in a switch: &quot;default is unsupported; use case _ instead.&quot;<br><br><br><div class="gmail_quote"></div></div></div><div dir="ltr"><div><div class="gmail_quote"><div dir="ltr">On Fri, Jun 17, 2016 at 1:45 PM E. Maloney via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:<br></div></div></div></div><div dir="ltr"><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">While upgrading to Swift 3, I noticed that I had a few enums with cases named .Default that, after being converted to lowercase, now need to be rendered using the ugly .`default` notation.<br>
<br>
I also noticed something similar while reading the docs for NotificationCenter (the NSNotificationCenter replacement, that is, not the NotificationCenter that governs the notification center UI); “default” can’t be used as a function name without escaping, so the declaration is:<br>
<br>
class func `default`()<br>
<br>
It seems to me that in the case of function names and enum cases, the parser should be able to unambiguously distinguish between the Swift keyword “default” and a user-defined name “default”, since IIRC the keyword “default” can only be used in parameter lists for generated headers and as the last item in a switch statement.<br>
<br>
(Perhaps this is also another argument in favor of using “case _:” in place of “default:” in a switch statement.)<br>
<br>
What do you think? Is there any reason this *wouldn’t* be feasible?<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>
</blockquote></div></div></div>
_______________________________________________<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>
</blockquote></div>