Skip to content

Comments

Migrate to Swift 6.0+ and Swift 6 language mode#170

Merged
czechboy0 merged 5 commits intoapple:mainfrom
czechboy0:hd-swift-6-language-mode
Feb 24, 2026
Merged

Migrate to Swift 6.0+ and Swift 6 language mode#170
czechboy0 merged 5 commits intoapple:mainfrom
czechboy0:hd-swift-6-language-mode

Conversation

@czechboy0
Copy link
Contributor

Motivation

We were still using Swift 5 language mode.

Modifications

  • enabled Swift 6 language mode
  • updated CI to 6.0+
  • added most of our standard upcoming feature flags and updated code to get zero warnings

Left out one flag: NonisolatedNonsendingByDefault - will look into that separately, as it might break our API if we're not careful.

Result

Modernized code.

Test Plan

Locally passes without warnings on macOS and Linux 6.2. The rest to be tested on CI.

@czechboy0 czechboy0 requested a review from FranzBusch February 20, 2026 16:32
@czechboy0 czechboy0 added the 🆕 semver/minor Adds new public API. label Feb 20, 2026
@czechboy0
Copy link
Contributor Author

Merging over the red API breakage checker, as it doesn't seem to respect @preconcurrency:

5 breaking changes detected in OpenAPIRuntime:
  💔 API breakage: func AsyncSequence.asDecodedJSONLines(of:decoder:) has generic signature change from <Self, Event where Self : Swift.Sendable, Self : _Concurrency.AsyncSequence, Event : Swift.Decodable, Self.Element == Swift.ArraySlice<Swift.UInt8>> to <Self, Event where Self : Swift.Sendable, Self : _Concurrency.AsyncSequence, Event : Swift.Decodable, Event : Swift.SendableMetatype, Self.Element == Swift.ArraySlice<Swift.UInt8>>
  💔 API breakage: func AsyncSequence.asDecodedJSONLines(of:decoder:) is now with @preconcurrency
  💔 API breakage: func AsyncSequence.asDecodedJSONSequence(of:decoder:) has generic signature change from <Self, Event where Self : Swift.Sendable, Self : _Concurrency.AsyncSequence, Event : Swift.Decodable, Self.Element == Swift.ArraySlice<Swift.UInt8>> to <Self, Event where Self : Swift.Sendable, Self : _Concurrency.AsyncSequence, Event : Swift.Decodable, Event : Swift.SendableMetatype, Self.Element == Swift.ArraySlice<Swift.UInt8>>
  💔 API breakage: func AsyncSequence.asDecodedJSONSequence(of:decoder:) is now with @preconcurrency
  💔 API breakage: func AsyncSequence.asDecodedServerSentEventsWithJSONData(of:decoder:while:) is now with @preconcurrency

@czechboy0 czechboy0 merged commit 4443113 into apple:main Feb 24, 2026
94 of 97 checks passed
@czechboy0 czechboy0 deleted the hd-swift-6-language-mode branch February 24, 2026 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🆕 semver/minor Adds new public API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants