[swift-evolution] [Idea] Deprecate the 'default' keyword.

Ross O'Brien narrativium+swift at gmail.com
Sat Feb 27 08:31:38 CST 2016


Let's make this a topic of its own.

As mentioned recently in the '[Idea] Allowing most keywords after "."'
thread, the 'default' keyword is only used as a keyword in switch
statements, where it's synonymous with 'case _:'.
It's also the kind of word which appears commonly in enums.

So, why do we need to keep it as a keyword?

Disadvantages: there would be some breaking of code, but a migration tool
should have little difficulty replacing 'default:' with 'case _:' in all
cases.

Alternatives: replace 'default' with 'else'.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160227/7d589534/attachment.html>


More information about the swift-evolution mailing list