-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
[sending] Add support for 'sending' #73696
Conversation
…' instead of 'transferring'. We still only parse transferring... but this sets us up for adding the new 'sending' syntax by first validating that this internal change does not mess up the current transferring impl since we want both to keep working for now. rdar://128216574
…ransferring. Just trying to slice off a larger change where I change these tests to actually use 'sending'. This is nice to do now since it is algebraic to do. rdar://128216574
@swift-ci smoke test |
A few things: 1. Internally except for in the parser and the clang importer, we only represent 'sending'. This means that it will be easy to remove 'transferring' once enough time has passed. 2. I included a warning that suggested to the user to change 'transferring' -> 'sending'. 3. I duplicated the parsing diagnostics for 'sending' so both will still get different sets of diagnostics for parsing issues... but anywhere below parsing, I have just changed 'transferring' to 'sending' since transferring isn't represented at those lower levels. 4. Since SendingArgsAndResults is always enabled when TransferringArgsAndResults is enabled (NOTE not vis-a-versa), we know that we can always parse sending. So we import "transferring" as "sending". This means that even if one marks a function with "transferring", the compiler will guard it behind a SendingArgsAndResults -D flag and in the imported header print out sending. rdar://128216574
I am doing this after the main transformation to ease commit by commit understanding of the change. rdar://128216574
5a1e07b
to
3d456ed
Compare
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.
LGTM, when do you think we'll remove transfering
- will we be able to drop it in the final 6.0 or may have to tag it along longer? 🤔
Cool thx, when this lands I'll follow up with some changes in distributed
I think this also needs a corresponding parser change in swift-syntax. |
@swift-ci smoke test |
…e SE-0430 an upcoming feature. I also added support for expressing suppressable upcoming features. rdar://128216574
@swift-ci smoke test |
This PR adds support to the compiler for 'sending'. It does not completely remove 'transferring' (since it may already be used). Instead what it does is:
Internally except for in the parser and the clang importer, we only represent
'sending'. This means that it will be easy to remove 'transferring' once enough
time has passed.
I included a warning that suggested to the user to change 'transferring' ->
'sending'.
I duplicated the parsing diagnostics for 'sending' so both will still get
different sets of diagnostics for parsing issues... but anywhere below parsing,
I have just changed 'transferring' to 'sending' since transferring isn't
represented at those lower levels.
Since SendingArgsAndResults is always enabled when TransferringArgsAndResults
is enabled (NOTE not vis-a-versa), we know that we can always parse sending. So
we import "transferring" as "sending". This means that even if one marks a
function with "transferring", the compiler will guard it behind a
SendingArgsAndResults -D flag and in the imported header print out sending.
rdar://128216574