Swift 6.2 as minimum toolchain version and concurrency fixes #63
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
These 5 fixes are intertwined and were difficult to split out, so here's one PR that fixes them all.
Modifications
The PR enables NonisolatedNonsendingByDefault, which caused an error in the existing combineLatest implementation, which we wanted to replace anyway.
So we vendor in the code from Swift Async Algoritms (the PR is open here: apple/swift-async-algorithms#360), the plan is to remove this copy when it lands in async algos.
Updating the combineLatest implementation to the correct one requires the async sequences to be Sendable, which in turn requires Swift 6.2 for us to be able to spell
any (AsyncSequence & Sendable)correctly, it doesn't work on 6.1.We also enabled the explicit sendable warning in CI, helping us ensure all our public API is explicitly annotated as Sendable or not.
Result
Addressed 5 important issues that impact the API and concurrency.
Test Plan
TODO: I'll write more tests for the new combineLatest implementation and add more failure cases, as the bug in the existing implementation was in how errors are rethrown.