SE-0297: Concurrency Interoperability with Objective-C

When the completion handler is optional (and defaults to nil), should the async method have the @discardableResult attribute? (And vice versa.)

 class NSExtensionContext: NSObject {
 
   func open(_: URL, completionHandler: ((Bool) -> Void)? = nil)
 
+  @discardableResult
+  func open(_: URL) async -> Bool
 }

When the result is discarded, can overload resolution prefer the non-async method?

6 Likes