-
Notifications
You must be signed in to change notification settings - Fork 440
Parse @unsafe nonisolated conformance #3112
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
Parse @unsafe nonisolated conformance #3112
Conversation
This is needed to account for 'nonisolated' occuring after type attributes within a protocol conformance.
The only "late" specifier at the moment is `nonisolated`, used by protocol conformances. Fixes issue swiftlang#3109.
@swift-ci please test |
@swift-ci please test |
@swift-ci please test |
@swift-ci please test Windows |
@swift-ci please test |
@swift-ci please test Windows |
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.
Thank you. It’s a little sad that we are not consistent with the ordering of attributes and specifiers in front of types but I assume we can’t do anything about that anymore, can we? That’s probably also why I’m not a huge fan of the name lateSpecifiers
but I don’t have a better suggestion, it’s about as clear as it gets.
Would like to hear @rintaro’s feedback as well.
case .collection(_, collectionElementName: let childElt?, _, _, generateDeprecatedAddFunction: true) = child | ||
.kind |
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.
Interesting formatting choice by swift-format here. swift-format seems to be happy with the following as well, which I’d prefer
case .collection(_, collectionElementName: let childElt?, _, _, generateDeprecatedAddFunction: true) = child | |
.kind | |
case .collection(_, collectionElementName: let childElt?, _, _, generateDeprecatedAddFunction: true) = | |
child.kind |
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.
Formatting fix in #3114 because I too eagerly pushed "merge"
An alternative approach here would be to handle the specifiers different for the places where we can have modifiers, i.e. parameters (where things like |
A protocol conformance can have a conformance attribute (like
@unsafe
) along withnonisolated
. Extend the syntax tree to allow type specifiers after the type attributes, and parsenonisolated
in that position.Fixes #3109.