-
Notifications
You must be signed in to change notification settings - Fork 439
[SwiftParser] SE-0478: Implement using
declaration under an experim…
#3087
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
Conversation
swiftlang/swift#81863 |
swiftlang/swift#81863 |
swiftlang/swift#81863 |
precondition(attrs.attributes.isEmpty) | ||
precondition(attrs.modifiers.isEmpty) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t think we necessarily need to crash the parser if attrs.attributes
or attrs.modifiers
is not empty. instead, we can shove them into unexpectedBeforeUsingKeyword
. If for some reason they end up being non-nil that gives the user a better diagnostic that they can go off (plus doesn’t crash source tooling).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I can look into that, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ahoppen does https://github.com/swiftlang/swift-syntax/pull/3087/files#diff-c777f9d3f9b258a7fc0c0f38f58e174c935a477c5bc8612a46c78bb23beba172R472-R493 makes sense or there is a better way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thank you.
…ental feature 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.
swiftlang/swift#81863 |
swiftlang/swift#81863 |
…ental feature
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.