[swift-evolution] optional variable with ternary operator

Suresh Kansujiya suresh.kansujiya at gmail.com
Mon May 8 02:36:45 CDT 2017


i am using ternary operator with optional variable. like below ex.

> *var number:Int?**let result = number > 0 ? 1 : 2  *

*here i am getting this waring : comparison operators with optionals were
removed from the Swift Standard Library. Consider refactoring the code to
use the non-optional operators*
Note : i must need to use ternary operator for checking.

Suresh Kansujiya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170508/9ff4e643/attachment.html>

More information about the swift-evolution mailing list