[swift-evolution] [Review] SE 0192 - Non-Exhaustive Enums
swift at nattinger.net
Tue Jan 2 15:27:42 CST 2018
>> in what other circumstances do we insist that the compiler inform the end user about future additions to the API at compile time?
> This isn’t a request for the compiler to inform the user about future additions to an API. It is a request to validate the compiler’s knowledge of the current state of an API with the current state of the source code.
> Well, it's of course impossible to inform the user about future additions, so that's poorly phrased on my part. It's about the compiler informing the end user about *new* additions, part of the *current* state of the API, that have cropped up since the user last revised the code when the API was in a *previous* state (or, indistinguishably, members of which a user is unaware regardless of the temporal sequence of when such members were added). In what other circumstances do we insist that the compiler perform this service?
Enums. That's literally how they work today. You are arguing in favor of actively removing compiler-aided correctness.
There's also protocol requirements and, arguably, deprecated methods with a proper message ("use foo instead").
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution