Repository navigation
Stop emitting @preconcurrency for Foundation imports on Linux - #969
Merged
czechboy0 merged 2 commits intoOct 13, 2026
Merged
Conversation
Generated code depends on swift-openapi-runtime, which requires Swift 6.2. On Linux in Swift 6.2, URL, Data and Date come from swift-foundation and are Sendable, so the @preconcurrency attribute is no longer needed. Under strict memory safety it produces a warning, which becomes an error in generated sources for adopters building with warnings as errors.
zunda-pixel
force-pushed
the
drop-foundation-preconcurrency
branch
from
October 11, 2026 17:56
b5033f9 to
2b70508
Compare
czechboy0
self-requested a review
October 11, 2026 18:13
czechboy0
approved these changes
Oct 13, 2026
czechboy0
left a comment
Contributor
There was a problem hiding this comment.
Thanks, @zunda-pixel 🙏
I also cleaned up the generator code that emits this, while we're in this area.
czechboy0
enabled auto-merge (squash)
October 13, 2026 15:27
czechboy0
disabled auto-merge
October 13, 2026 15:59
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.
Motivation
On Linux, generated files import
URL,DataandDatewith@preconcurrency, which triggers aStrictMemorySafetywarning. With warnings as errors, generated code fails to build. The attribute is unnecessary since the runtime requires Swift 6.2, where these types areSendableon Linux.Modifications
Remove
@preconcurrencyfrom the generated Foundation imports, and update the reference and example sources.