[swift-users] try? priority

J.E. Schotsman jeschot at xs4all.nl
Thu Aug 4 09:38:26 CDT 2016

I was surprised when I got a compiler error for this code:

if try? MyThrowingFunction() != nil {…}     (MyThrowingFunction does not return an optional value)

This compiles:

if (try? MyThrowingFunction) != nil {…}     (Xcode 7.3.1)

Shouldn’t try? have higher priority than != here?

Please disregard if this is changed in Swift 3

Jan E.

More information about the swift-users mailing list