Repository navigation
Fix Swift 6.4 compiler warnings - #271
Merged
Merged
Conversation
- With Swift 6.4, call withChecked(Throwing)Continuation without an isolation argument so it picks the nonisolated(nonsending) overload. Older compilers keep passing isolation explicitly: without it, Swift 6.0 runs the body off the actor and crashes. - Require SendableMetatype on AsyncBufferedIteratorProtocol (Swift 6.2+), as EventQueue does. Iterators are taken out of an actor and advanced with the nonisolated nextBuffer, so an isolated conformance is unsafe. - Avoid capturing the Buffer metatype in nextElements. - Discard unused throwing Tasks explicitly in sources and tests, and use the HTTPHeaders WebSocket response initialiser in the test mock.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #271 +/- ##
==========================================
- Coverage 93.95% 93.77% -0.18%
==========================================
Files 74 74
Lines 4035 4033 -2
==========================================
- Hits 3791 3782 -9
- Misses 244 251 +7 ☔ View full report in Codecov by Harness. |
Mark it unavailable, renamed to methods, and remove its test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes the warnings the Xcode 27 (Swift 6.4) CI job reports, plus the remaining deprecation warnings on Linux. Behaviour on older toolchains is unchanged.
withChecked(Throwing)Continuationwithoutisolation:so the nonisolated(nonsending) overload is used. Older compilers still passisolationexplicitly (#if compiler(>=6.4)). Dropping it on Swift 6.0 runs the body off the actor and crashes with "Incorrect actor executor assumption".SendableMetatypeon Swift 6.2+, asEventQueuealready does. The buffering actors take the iterator out and call the nonisolatednextBuffer, so an isolated conformance would be unsafe. This fixes the isolated-conformance warnings inAsyncBufferingSequenceandAsyncSharedReplaySequence.Buffermetatype (map(Array.init)).Tasks are discarded with_ =inAsyncSocketand two test files, and the WebSocket response mock uses theHTTPHeadersinitialiser.HTTPRoute.method(renamed tomethods),JSONPredicatePatternand.json(where:)(useJSONBodyPattern) are nowunavailable, and their tests are removed. This is source-breaking for anyone still using them.WebSocketHTTPHandlerno longer picks the deprecated[HTTPHeader: String]HTTPResponseinitialiser, and the Linux-only datagram tests use the asyncclose().Testing
swift build --build-testshas no warnings, and all tests pass.container: Swift 6.0, 6.2 and 6.4 build and pass the full suite, 3 runs each. After the later commits, Swift 6.0 and 6.4 were rerun once: no source or test warnings, and all tests pass.🤖 Generated with Claude Code