[swift-evolution] Optional precondition after else and #else

Adrian Kashivskyy adrian.kashivskyy at me.com
Tue Dec 8 17:34:01 CST 2015


How is this different from `else if`? 😄

> if a > 0 {
> 	...
> } else if a < -5 {
> 	...
> }

Pozdrawiam – Regards,
Adrian Kashivskyy

> Wiadomość napisana przez Amir Michail via swift-evolution <swift-evolution at swift.org> w dniu 08.12.2015, o godz. 14:47:
> 
> For example:
> 
> if a > 0 {
> ….
> } else a < -5 {
> …
> }
> 
> This would be the same as:
> 
> if a > 0 {
> ….
> } else {
>  precondition(a < -5)
> …
> }

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151209/2d7cd923/attachment.html>


More information about the swift-evolution mailing list