I'm also seeing this issue. If anyone from the dev team is reading this, the issue appears to stem from some naming inconsistencies when translating the new async/await
syntax to obj-c.
Since a Swift function with a completion block is now automatically generating two versions of the function, one with a completion block and one with the async/await syntax, it appears that Xcode is generating two method signatures that are functionally equivalent, but are using slightly different strings for the parameter names. So, I think the string matching logic is treating these as unique, but the compiler sees them as duplicates.
The generated Swift code:
@objc(handleOpenReader:completion:)
func handle(intent: OpenReaderIntent, completion: @escaping (OpenReaderIntentResponse) -> Swift.Void)
@available(iOS 15.0, macOS 12.0, watchOS 8.0, *)
@objc(handleOpenReader:completion:)
func handle(intent: OpenReaderIntent) async -> OpenReaderIntentResponse
The translated Obj-c code:
- (void)handleOpenReader:(OpenReaderIntent * _Nonnull)intent completion:(void (^ _Nonnull)(OpenReaderIntentResponse * _Nonnull))completion;
- (void)handleOpenReader:(OpenReaderIntent * _Nonnull)intent completion:(void (^ _Nonnull)(OpenReaderIntentResponse * _Nonnull))completionHandler SWIFT_AVAILABILITY(watchos,introduced=8.0) SWIFT_AVAILABILITY(macos,introduced=12.0) SWIFT_AVAILABILITY(ios,introduced=15.0);
In the objc code you can see that the two methods use different naming for the completion block. One names it completion
and the other names it completionHandler
. I suspect this is breaking a script somewhere in the process.