While I see the apparent inconsistency at the call site, there is a deeper difference.
x + 3
is not a syntactic variant of x.+(3)
— for some hypothetical instance method named +(_:)
— but is rather +(x, 3)
— for some actual global/static function whose name is +(_:_:)
.
So, I see the inconsistency as a reflection of the fact that optional chaining doesn't reach "into" function parameters, though that feature has been requested before , e.g. here and here.
The other difference is that there's no clear chaining in x? + 3
, which is another way of saying what @scanon said. With a form like x?.plus(3)
it's obvious where the "chain points" are in an expression. With x? + 3
, it's not entirely clear which subexpressions are evaluated before or after the point where an overall nil
result can be produced.
Assuming all of that could be sorted out syntactically and semantically, I think operator chaining would still be problematic, because it overloads ?
use-cases so far as to potentially make ?
seem like a magical DWIM operator.
It's not a terrible idea, I think, but I'd sure prefer if we could continue to manage without it.