-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[6.2][AST/Sema] SE-0478: Implement using declaration under an experimental flag #81997
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
xedin
merged 14 commits into
swiftlang:release/6.2
from
xedin:using-for-default-isolation-in-file-context-6.2
Jun 5, 2025
Merged
[6.2][AST/Sema] SE-0478: Implement using declaration under an experimental flag #81997
xedin
merged 14 commits into
swiftlang:release/6.2
from
xedin:using-for-default-isolation-in-file-context-6.2
Jun 5, 2025
Conversation
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
Initially this declaration is going to be used to determine per-file default actor isolation i.e. `using @MainActor` and `using nonisolated` but it could be extended to support other file-global settings in the future. (cherry picked from commit aabfebe)
…fier position (cherry picked from commit 816ea9f)
(cherry picked from commit 4b5105d)
(cherry picked from commit 202907d)
(cherry picked from commit 4ad27ba)
…f `.swift` These are split-file C++ tests, this is a problem for swift-syntax because `.swift` tests get parsed for round-trip testing if swift-syntax is located near swift. (cherry picked from commit c019b66)
The default isolation is computed based on `using` declaration found in the file, if any. (cherry picked from commit 36b7711)
These declarations are effectively `fileprivate` at the moment and should appear in swift interfaces. (cherry picked from commit ad71e07)
…experimental feature (cherry picked from commit c246a7a)
Infer default actor isolation from `using` declaration in the file scope and use it to override one that is set by `-default-isolation` flag. (cherry picked from commit 595c3b3)
… isolation (cherry picked from commit ec9132c)
(cherry picked from commit 21ec592)
(cherry picked from commit 83ac0f5)
(cherry picked from commit bc61bfb)
swiftlang/swift-syntax#3093 |
bnbarham
approved these changes
Jun 4, 2025
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.
Cherry-pick of #81863
Explanation:
This is an alternative spelling of
typealias DefaultIsolation = (MainActor | nonisolated)
that was proposed as part of SE-0478.using
declaration accepts an attribute or a modifier and currently could be used to set a default actor isolation per file, but could be extended to support other use-cases in the future.Implementation uses
DefaultIsolationPerFile
experimental feature flag to hide the syntax.Resolves: rdar://152598259
Main Branch PR: [AST/Sema] SE-0478: Implement
using
declaration under an experimental flag #81863Risk: Low. This is a new feature under an experimental flag which isn't enabled by default and currently has no adopters.
Reviewed By: @hamishknight @ktoso
Testing: Added new test-cases to the test suite.