[swift-evolution] Handling unknown cases in enums [RE: SE-0192]

Chris Lattner clattner at nondot.org
Sat Jan 13 00:49:25 CST 2018


> On Jan 12, 2018, at 3:08 PM, Jordan Rose <jordan_rose at apple.com> wrote:
> 
> Okay, I went back to `unknown case` in the proposal, but mentioned Chris's point very specifically: if the compiler emits an error, we should go with `case #unknown` instead. (I'm very strongly in the "warning" camp, though.)

Thanks!

Out of curiosity, why not “unknown default:”?  The “warning” behavior is a customization of default, so this seems like a more logical model.  It also fits into the existing Swift grammar, unlike “unknown case:” which requires adding a new special case production.

-Chris



More information about the swift-evolution mailing list