<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 19, 2017, at 2:58 PM, Ted Kremenek via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><div class=""><p class="" style="font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; -webkit-print-color-adjust: exact; margin: 15px 0px; font-family: Helvetica, arial, sans-serif; background-color: rgb(255, 255, 255);">When reviewing a proposal, here are some questions to consider:</p><ul class="" style="font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; -webkit-print-color-adjust: exact; margin: 15px 0px; padding-left: 30px; font-family: Helvetica, arial, sans-serif; background-color: rgb(255, 255, 255);"><li class="" style="-webkit-print-color-adjust: exact; margin: 0px;"><p class="" style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;">What is your evaluation of the proposal?</p></li></ul></div></blockquote>Strong -1 as is.</div><div><br class=""></div><div>I think I would support having an explicit ‘futureCase’ which is different from ‘default’. &nbsp;Requiring default is asking for bugs. &nbsp;With a separate ‘futureCase’, we would still get a compile-time error when all of the current cases aren’t handled. &nbsp;Note that ‘&nbsp;futureCase’ is also different than ‘default’ in that it wouldn’t have to go at the bottom. &nbsp;It would only be triggered when the value isn’t one of the values which was known at compile time. &nbsp;We should also bike shed the name of ‘futureCase’ to come up with something that might allow us to make other types of extendable enums…. &nbsp;Maybe something like ‘unknownCase’ or ‘unexpectedCase’.</div><div><br class=""></div><div>As for the issue of testing, we could add (later) a universally unexpected case that non-exhaustive enums can be set to for testing. I am not convinced that this is actually a big enough issue to warrant that though. Forcing ‘default’ is a much larger real-world problem, IMO (and this use of ‘default’ is just as untestable).</div><div><br class=""></div><div>I also dislike the name @exhaustive because I think it will cause confusion (i.e. “Of course my Enum is exhaustive”). &nbsp;I think we should just have @fixed for both enums and structs. The word fixed has the connotation that it shouldn’t change.</div><div><br class=""></div><div><blockquote type="cite" class=""><div class=""><ul class="" style="font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; -webkit-print-color-adjust: exact; margin: 15px 0px; padding-left: 30px; font-family: Helvetica, arial, sans-serif; background-color: rgb(255, 255, 255);"><li class="" style="-webkit-print-color-adjust: exact; margin: 0px;"><p class="" style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;">Is the problem being addressed significant enough to warrant a change to Swift?</p></li></ul></div></blockquote>Yes, I think the problem is significant, but this is not the correct solution.<br class=""><blockquote type="cite" class=""><div class=""><ul class="" style="font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; -webkit-print-color-adjust: exact; margin: 15px 0px; padding-left: 30px; font-family: Helvetica, arial, sans-serif; background-color: rgb(255, 255, 255);"><li class="" style="-webkit-print-color-adjust: exact; margin: 0px;"><p class="" style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;">Does this proposal fit well with the feel and direction of Swift?</p></li></ul></div></blockquote>Not quite. &nbsp;While I think ABI safety is Swifty, I feel like this design actually encourages a lack of safety in other areas. &nbsp;Much better to explicitly deal with the issue of added/future cases in code than to hide it with ‘default’.</div><div><br class=""><blockquote type="cite" class=""><div class=""><ul class="" style="font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; -webkit-print-color-adjust: exact; margin: 15px 0px; padding-left: 30px; font-family: Helvetica, arial, sans-serif; background-color: rgb(255, 255, 255);"><li class="" style="-webkit-print-color-adjust: exact; margin: 0px;"><p class="" style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;">If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?</p></li></ul></div></blockquote><div>I have used Enums in several languages, but Swift is the only one which has required exhaustive enums… I have a hard time going back to languages which don’t have it now.</div><br class=""><blockquote type="cite" class=""><div class=""><ul class="" style="font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; -webkit-print-color-adjust: exact; margin: 15px 0px; padding-left: 30px; font-family: Helvetica, arial, sans-serif; background-color: rgb(255, 255, 255);"><li class="" style="-webkit-print-color-adjust: exact; margin: 0px;"><p class="" style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;">How much effort did you put into your review? A glance, a quick reading, or an in-depth study?</p></li></ul></div></blockquote></div>Thoroughly read proposal, casually followed the original discussion.<div class=""><br class=""></div><div class="">Thanks,</div><div class="">Jon<br class=""><div class=""><br class=""></div><div class=""><br class=""></div></div></body></html>