[swift-evolution] Warning when omitting default case for imported enums
Tino Heth
2th at gmx.de
Sat Feb 11 05:11:42 CST 2017
> Closed would not be an access level, just an attribute orthogonal to the others.
As Xiaodi pointed out, there's still no agreement on that — so basically I'm saying that I prefer your interpretation, because imho five access levels are already a alarmingly high number.
> What do you mean by the six different flavors?
1) cases with associated objects
2) raw-based enums
3) everything else (not that much different from int-based)
With the new attribute, there would be a new variant for each type, therefor six flavours (I choose this term because it's only small variation — but still, it might look quite complex to someone coming from C or Java).
The major issue I have with this change is how it will work in real live:
When I write a library and declare that I'll never add new cases to an enum, who will enforce this?
Will the compiler interact with git and look for release tags, or will there be a lockdown-command that records all cases and compares them with the last time the command was triggered?
This feels really brittle to me, and I haven't seen a approach that would be fundamental different (and better).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170211/1f1224c8/attachment.html>
More information about the swift-evolution
mailing list