> What I’m proposing is that we introduce a new keyword, unknown (or a better 
> name), that serves as a way to handle cases that aren’t yet known, but not 
> those that are.
Afaics, the best this could do is helping when a compiled library using 
another, updated library with new cases in a switch — but in the common case, 
that enum would be used in the source code of an app.
So, to be useful, you’ll need some sort of version annotation in your source, 
or the compiler will not be able to tell which cases have been added since you 
wrote a switch.

Also, I really don’t think that exhaustive switching on „alien“ enums is one of 
the best features in Swift (of course, that depends on what count you allow for 
a feature to be one of the best ;-):
At least, I don’t see big harm in the proposal. I haven’t seen many examples of 
framework-defined enums that are extended, and used in switch-statements in 
client code.
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to