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
error: stored property 'xcTestCompatibleSelector' of 'Sendable'-conforming struct 'Test' has non-sendable type '__XCTestCompatibleSelector?' (aka 'Optional<Selector>')
#491
Closed
toffaletti opened this issue
Jun 17, 2024
· 4 comments
Using swift-6.0-DEVELOPMENT-SNAPSHOT-2024-06-12-a.xctoolchain on macOS, I'm unable to use swift testing because of this error.
Expected behavior
I expect swift test --disable-xctest would build and run my tests.
Actual behavior
.build/checkouts/swift-testing/Sources/Testing/Test.swift:69:14: error: stored property 'xcTestCompatibleSelector' of 'Sendable'-conforming struct 'Test' has non-sendable type '__XCTestCompatibleSelector?' (aka 'Optional<Selector>')
67 | /// property is always `nil`.
68 | @_spi(ForToolsIntegrationOnly)
69 | public var xcTestCompatibleSelector: __XCTestCompatibleSelector?
| `- error: stored property 'xcTestCompatibleSelector' of 'Sendable'-conforming struct 'Test' has non-sendable type '__XCTestCompatibleSelector?' (aka 'Optional<Selector>')
70 |
71 | /// An enumeration describing the evaluation state of a test's cases.
ObjectiveC.Selector:1:23: note: struct 'Selector' does not conform to the 'Sendable' protocol
1 | @frozen public struct Selector : ExpressibleByStringLiteral {
| `- note: struct 'Selector' does not conform to the 'Sendable' protocol
2 | public init(_ str: String)
3 | public init(stringLiteral value: String)
Steps to reproduce
Install swift-6.0-DEVELOPMENT-SNAPSHOT-2024-06-12-a.xctoolchain from swift.org
I coincidentally just encountered this build failure also, but only when attempting to build using a newer Swift 6 development snapshot toolchain paired with an older Xcode 15.x. The newer Xcode 16 Beta contains SDKs whose ObjectiveC module has the Selector type marked Sendable, but earlier versions did not, so building using Xcode 16 Beta succeeds.
The other relevant factor which changed recently is that swift-testing's Package.swift changed to swift-tools-version: 6.0 in #467, and that in turn caused all of the package's targets to begin using the Swift 6 language mode.
I do not yet understand why this failure is not being hit by our CI system though, since it's using Xcode 15.1.
At this point, unless we identify some hard blocker which forces us to continue supporting versions of Xcode earlier than 16 Beta, we are inclined to close this and not make any workaround code changes. To anyone who encounters this problem, please ensure you are building using Xcode 16 Beta or later. This requirement has already been documented as part of the changes in #466
Description
Using
swift-6.0-DEVELOPMENT-SNAPSHOT-2024-06-12-a.xctoolchain
on macOS, I'm unable to use swift testing because of this error.Expected behavior
I expect
swift test --disable-xctest
would build and run my tests.Actual behavior
Steps to reproduce
swift-6.0-DEVELOPMENT-SNAPSHOT-2024-06-12-a.xctoolchain
from swift.orgswift test --disable-xctest
swift-testing version/commit hash
da1d5ac
Swift & OS version (output of
swift --version ; uname -a
)The text was updated successfully, but these errors were encountered: