Closed Tyler-Keith-Thompson closed 4 months ago
@Tyler-Keith-Thompson Can you attach a full project that can be opened in Xcode 16 to demonstrate the problem? Also, I'm inclined to convert this to a discussion for the moment, since we're talking Apple beta, but if you can share an easy repro we'll find the time to check it out soon.
This sample project reproduces the problem, simply open the Package with Xcode 16 and Command + U.
I'm all good for converting to a discussion, I've certainly brought this up very early.
Description
When using Swift-Testing 0.10.0 and the Xcode 16 beta I'm running into some unexpected behavior. If you use the Swift-Testing
try await confirmation {
inside atry await withMainSerialExecutor {
closure, you get the following error:There's a temporary workaround where you can simply reverse the order, have
try await confirmation
outside andtry await withMainSerialExecutor
inside that closure, but this isn't practical for all use cases.I also realize this is a beta and subject to change, but I thought I'd report this anyways.
Checklist
main
branch of this package.Expected behavior
I guess I'm not sure? If there really is a data race risk then it seems like that risk should exist in either case, but it seems like a false positive.
Actual behavior
Error: Sending main actor-isolated value of type '(Confirmation) async throws -> ()' with later accesses to nonisolated context risks causing data races
Steps to reproduce
swiftLanguageVersions: [.version("6")]
.package(url: "https://github.com/apple/swift-testing.git", from: "0.10.0")
swift-concurrency-extras version information
1.1.0
Destination operating system
macOS 14.5
Xcode version information
16 Beta (16A5171c)
Swift Compiler version information