-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Swift-Testing Swift 6 Strict Concurrency Legit Build Failure? #74882
Comments
|
cc @grynspan |
extension Tests {
@Test func exampleWorkaround() async throws {
do {
try await doSomething(self.count)
} catch {
#expect(false)
}
}
}I'm unblocked with this workaround. |
|
@vanvoorden I believe this is already fixed... can you try this with the latest snapshot or baring that, provide a full swift package that I can build that reproduces this? |
|
@gottesmm This looks fixed in |
|
Thanks for confirming! |
|
@grynspan Ahh… actually the original test case was fixed… but this version still looks broken in func doSomething(_: Int) async throws {
}
@Suite actor Tests {
let count = 0
}
extension Tests {
@Test func exampleFails() async throws {
await #expect {
try await doSomething(self.count)
} throws: { _ in
return true
}
}
}With a similar error: |
|
D'oh! |
|
@grynspan FWIW I am still unblocked on this new test case with a similar workaround from before. |
https://github.com/vanvoorden/2024-08-05/ @gottesmm Here is the new repro. Thanks! |
Description
https://forums.swift.org/t/swift-testing-swift-6-strict-concurrency-legit-build-failure/72824/1
Hi! I'm experimenting with
swift-testingand Swift 6 strict concurrency checking. I'm seeing some not-super-clear build failure. Maybe this is something that should work and might be fixed later this year… or maybe it's a legit failure and I should rethink how this test is built.Here is a test that builds (and passes) from Swift 6 strict concurrency:
Here is a test that fails to build from Swift 6 strict concurrency:
Here is the failure:
Any ideas about what else I can do about that? I don't see this error when building from Swift 5 mode. Is this error legit? Should I rethink how I'm building this test? Any ideas about that would be great. Thanks!
Environment
swift-driver version: 1.110 Apple Swift version 6.0 (swiftlang-6.0.0.4.52 clang-1600.0.21.1.3)
Target: arm64-apple-macosx14.0
The text was updated successfully, but these errors were encountered: