Skip to content

Fix Swift 6.4 compiler warnings - #271

Merged
swhitty merged 2 commits into
mainfrom
fix-xcode27-warnings
Nov 15, 2026
Merged

swhitty merged 2 commits into
mainfrom
fix-xcode27-warnings

Conversation

@swhitty

@swhitty swhitty commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

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.

  • IdentifiableContinuation: on Swift 6.4, call withChecked(Throwing)Continuation without isolation: so the nonisolated(nonsending) overload is used. Older compilers still pass isolation explicitly (#if compiler(>=6.4)). Dropping it on Swift 6.0 runs the body off the actor and crashes with "Incorrect actor executor assumption".
  • AsyncBufferedIteratorProtocol now refines SendableMetatype on Swift 6.2+, as EventQueue already does. The buffering actors take the iterator out and call the nonisolated nextBuffer, so an isolated conformance would be unsafe. This fixes the isolated-conformance warnings in AsyncBufferingSequence and AsyncSharedReplaySequence.
  • nextElements no longer captures the Buffer metatype (map(Array.init)).
  • Unused throwing Tasks are discarded with _ = in AsyncSocket and two test files, and the WebSocket response mock uses the HTTPHeaders initialiser.
  • HTTPRoute.method (renamed to methods), JSONPredicatePattern and .json(where:) (use JSONBodyPattern) are now unavailable, and their tests are removed. This is source-breaking for anyone still using them.
  • On Linux, WebSocketHTTPHandler no longer picks the deprecated [HTTPHeader: String] HTTPResponse initialiser, and the Linux-only datagram tests use the async close().

Testing

  • macOS, Swift 6.4.2: swift build --build-tests has no warnings, and all tests pass.
  • Linux via 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

- 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

codecov Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.77%. Comparing base (9cc7e07) to head (26e119d).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

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.
📢 Have feedback on the report? Share it here.

Mark it unavailable, renamed to methods, and remove its test.
@swhitty
swhitty merged commit 555f1e8 into main Nov 15, 2026
14 of 15 checks passed
@swhitty swhitty changed the title Fix Swift 6.4 compiler warnings in FlyingSocks Fix Swift 6.4 compiler warnings Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant