<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jan 12, 2018, at 22:49, Chris Lattner <<a href="mailto:clattner@nondot.org" class="">clattner@nondot.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class=""><br class=""><blockquote type="cite" class="">On Jan 12, 2018, at 3:08 PM, Jordan Rose <<a href="mailto:jordan_rose@apple.com" class="">jordan_rose@apple.com</a>> wrote:<br class=""><br class="">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.)<br class=""></blockquote><br class="">Thanks!<br class=""><br class="">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.<br class=""></div></div></blockquote></div><br class=""><div class="">I'm not sure how this fits more into the existing grammar. Both of them require custom parsing with one token's worth of lookahead. You're right that they suggest different natural modelings in the <i class="">AST,</i> but that's an implementation detail.</div><div class=""><br class=""></div><div class="">To me, `unknown case` is more meaningful than `unknown default`: it matches cases (as in, enum elements declared with `case`) that the developer doesn't know about. "unknown default" is talking about two different things; the "default" part talks about the switch and the code that will be executed, while "unknown" is talking about the input. But this isn't something I feel too strongly about; it will go to review, people will express their opinions, and then you and the rest of the core team will pick one name or the other based on feedback.</div><div class=""><br class=""></div><div class="">(It's also shorter, which gives it 0.3 extra aesthetic points. But unlike attributes or modifiers, it's less common to put things on the same line as switch cases, so that matters a lot less.)</div><div class=""><br class=""></div><div class="">Jordan</div></body></html>