You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Concurrency errors related to the Sendable protocol are produced in a project, although it is configured for Swift 5.
This behavior is new in Xcode 16.0 beta 3 (16A5202i) and breaks the build.
Previous beta versions were not affected.
I've attached an Xcode project showing the issues.
Error 1 - Using WebKit:
import WebKit
This produces the following error: Add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'WebKit'
Error 2 - Using @preconcurrency
@preconcurrency import WebKit
In a Swift 5 project, this produces the following error: '@preconcurrency' attribute on module 'WebKit' has no effect
Error 3 - Closures and Sendable
let test = NSTreeController()
[self.observer](http://self.observer/) = self.observe( \.description )
{
_, _ in print( test )
}
Capture of 'test' with non-sendable type 'NSTreeController' in a @Sendable closure; this is an error in the Swift 6 language mode
These issues make building a Swift 5 project impossible with Xcode 16.0 beta 3.
The project indeed has warnings-as-errors enabled.
Disabling this is not a valid solution. Treating warnings as errors can be a requirement on some projects.
At least provide a way to turn these warnings in Swift 5 projects as a build setting.
Since there is a -warn-concurrency flag, please provide a -no-warn-concurrency or -disable-warn-concurrency so we can use them on specific files while keeping warning as errors on.
Description
Concurrency errors related to the Sendable protocol are produced in a project, although it is configured for Swift 5.
This behavior is new in Xcode 16.0 beta 3 (16A5202i) and breaks the build.
Previous beta versions were not affected.
I've attached an Xcode project showing the issues.
Error 1 - Using WebKit:
This produces the following error:
Add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'WebKit'
Error 2 - Using @preconcurrency
In a Swift 5 project, this produces the following error:
'@preconcurrency' attribute on module 'WebKit' has no effect
Error 3 - Closures and Sendable
Capture of 'test' with non-sendable type 'NSTreeController' in a
@Sendable
closure; this is an error in the Swift 6 language modeThese issues make building a Swift 5 project impossible with Xcode 16.0 beta 3.
Files
Test.zip
The text was updated successfully, but these errors were encountered: