[swift-evolution] Make distinction between ?? -> T and ?? -> T?
sebastien.blondiau at me.com
Mon Mar 7 15:29:59 CST 2016
Currently, there is only one nil coalescing operator, which may return an optional value or not, depending on the second parameter. This variability can leads to unclear line of code:
var isItOptionalOrNot = value ?? otherValue
I think there should be two distinct operators:
var certainlyOptional = value ?? otherValue
var certainlyNotOptional = value ?! notOptionalValue
In my point of view, this differentiation brings more clarity about wether the result is an optional or not.
What's your opinion?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution