Seeking workaround for issue #76171

I'm trying to compile a non-trivial project with swift that shipped with Xcode 16 RC so that we can take advantage of new features in iOS 18, but I'm running into Seemingly unrelated closure changes type signature when using `WKWebView.isInspectable` · Issue #76171 · swiftlang/swift · GitHub

I also posted about this on the Apple Dev Forums: Xcode 16 beta 6 - unexpected concu… | Apple Developer Forums

On the dev forums with help from @eskimo, we identified that if we compiled the offending WebKit extension separately from the NSItemProvider part, that we can avoid the problem.

In the trivial sample project I shared, this is easy to do, but in the actual project I'm working on, there seem to be multiple pieces of code that all need to be kept separate to avoid this bug, and I don't know how to identify them all.

What I've been trying to do is slowly strip down the project until I remove enough code to make the error go away, but this is painstakingly slow and I'm not convinced that I'll succeed in identifying everything that needs to be compiled separately.

Can anyone offer a workaround for this problem that could scale beyond a non-trivial project? Even informed speculation around potential root causes could help to make sense of how to approach this. Any help is appreciated!

We found a workaround — use Task instead of Task.detached. This works regardless of whether the compiler see the NSItemProvider closures as main-actor isolated.

2 Likes