<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 Feb 12, 2016, at 11:29 AM, David Turnbull &lt;<a href="mailto:dturnbull@gmail.com" class="">dturnbull@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Use preconditionFailure() instead of precondition(false).<br class=""><div class=""><br class=""></div></div></div></blockquote><div><br class=""></div><div>That works! But I think precondition(false) should also work.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="">-david</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Fri, Feb 12, 2016 at 7:59 AM, Amir Michail via swift-evolution <span dir="ltr" class="">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">For example:<br class="">
<br class="">
let x:Int<br class="">
if … { x = 1 }<br class="">
else if … { x = 2 }<br class="">
else { precondition(false) } // no initialization needed<br class="">
<br class="">
Similarly,<br class="">
<br class="">
let x:Int<br class="">
switch ... {<br class="">
case …: x = 1<br class="">
case …: x = 2<br class="">
default: precondition(false) // no initialization needed<br class="">
}<br class="">
_______________________________________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="">
</blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></body></html>