<div dir="ltr">Use preconditionFailure() instead of precondition(false).<br><div><br></div><div>-david</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 12, 2016 at 7:59 AM, Amir Michail via swift-evolution <span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">For example:<br>
<br>
let x:Int<br>
if … { x = 1 }<br>
else if … { x = 2 }<br>
else { precondition(false) } // no initialization needed<br>
<br>
Similarly,<br>
<br>
let x:Int<br>
switch ... {<br>
case …: x = 1<br>
case …: x = 2<br>
default: precondition(false) // no initialization needed<br>
}<br>
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</blockquote></div><br></div>