[Sema] Downgrade noasync diagnostic to warning for closure macro args#80853
Merged
Conversation
Contributor
Author
|
@swift-ci please test |
Contributor
Author
|
@swift-ci please test source compatibility |
hamishknight
commented
Apr 16, 2025
Contributor
Author
There was a problem hiding this comment.
I was originally hoping we could use namelookup::isInMacroArgument here, but we don't currently track macro expansion expressions in the ASTScope tree and it didn't really seem worth it for this change.
Previously we would avoid rewriting the arguments in CSApply, but that can result in incorrect behavior in MiscDiagnostics passes, e.g incorrectly treating all closure arguments as escaping. Make sure we rewrite the arguments as we would in regular type-checking. rdar://148665502
Introduce `Version::getFutureMajorLanguageVersion` to make it easier to find clients that will need to be updated once we have a new language mode.
Downgrade to a warning until the next language mode. This is necessary since we previously missed coercing macro arguments to parameter types, resulting in cases where closure arguments weren't being treated as `async` when they should have been. rdar://149328745
cba6b5f to
b36eb57
Compare
Contributor
Author
|
@swift-ci please test |
hborla
approved these changes
Apr 18, 2025
2 tasks
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.
Downgrade to a warning until the next language mode. This is necessary since we previously missed coercing macro arguments to parameter types, resulting in cases where closure arguments weren't being treated as
asyncwhen they should have been. This then allows us to reapply #80583.rdar://149328745
Resolves #80835