Re: [swift-evolution] optional variable with ternary operator

2017-05-08 Thread Saagar Jha via swift-evolution
Well, you’re not allowed to compare optionals any more. You can try binding the value to an Int, so that it’s not an optional anymore: if let number = number { let result = number > 0 ? 1 : 2 } Either way, you’ll have to decide what you think should happen when number is nil. Saagar Jh

[swift-evolution] optional variable with ternary operator

2017-05-08 Thread Suresh Kansujiya via swift-evolution
Hey, 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