mandatory "?" suffix for identifiers associated with optional types


(Tyler Mandry) #1

I agree with Adrian here – the problem IMO is the fact that you can do `x <
5` *at all* if x is optional.

Allowing programmers to do `x? < 5` still doesn't make clear what the
actual result of the operation will be if x is nil. In fact, I would
actually *expect* the result of the operation to be a Bool?, not a Bool
which is always false if x is nil.

···

--
Tyler Mandry


(thorsten@portableinnovations.de) #2

+1. I also think that < should not be defined for Optional.

-Thorsten

···

Am 06.12.2015 um 22:56 schrieb Tyler Mandry via swift-evolution <swift-evolution@swift.org>:

I agree with Adrian here – the problem IMO is the fact that you can do `x < 5` at all if x is optional.