This Swift compiler code seems to suggest that the synthesized wrapper method does handle nil completion handlers. So it seems like a bug in the code that generates the Objective-C interface?
Is that a warning or an error? I'm getting a warning, but I'm not on the latest Xcode.
It's not unseen that the final implementation doesn't follow proposal document 100%.
However in this case it looks like @discardableResult attribute should be taken into account when converting from swift to obj-c, symmetrically to what it does when going from obj-c to swift.
Oops, sorry for the imprecision. Yes, it’s a warning.
Oh do you mean if I add @discardableResult to the Swift method, the Objective-C translated method’s completion handler should be nullable? I tried it but still got the same warning.