Skip to content

[Sema]: improve noasync diagnostics in defer statement bodies #73841

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
merged 1 commit into from
May 26, 2024

Conversation

jamieQ
Copy link
Contributor

@jamieQ jamieQ commented May 23, 2024

updates noasync diagnostics in TypeCheckAvailability.cpp to diagnose defer bodies as if they had the same isAsyncContext() value as their nearest non-defer parent scope.

resolves: #73614 and rdar://128102432

@jamieQ jamieQ force-pushed the diagnose-noasync-in-defer branch 3 times, most recently from cb67424 to c52314b Compare May 24, 2024 13:33
@jamieQ jamieQ marked this pull request as ready for review May 24, 2024 13:40
@jamieQ jamieQ requested a review from tshortli as a code owner May 24, 2024 13:40
Copy link
Contributor

@tshortli tshortli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this! I'll dig up the radar to associate with it, I think there's one.

@tshortli
Copy link
Contributor

@swift-ci please smoke test

updates noasync diagnostics in TypeCheckAvailability.cpp to diagnose
defer bodies as if they had the same `isAsyncContext()` value as their
nearest non-defer parent scope.

resolves: swiftlang#73614
@jamieQ jamieQ force-pushed the diagnose-noasync-in-defer branch from c52314b to e68c36b Compare May 25, 2024 15:03
@tshortli
Copy link
Contributor

@swift-ci please test

@tshortli tshortli enabled auto-merge May 25, 2024 18:39
@tshortli tshortli merged commit 344a894 into swiftlang:main May 26, 2024
4 of 5 checks passed
@tshortli
Copy link
Contributor

@jamieQ we'd like to take this on release/6.0, could you cherry pick it to a PR based on that branch?

@jamieQ jamieQ deleted the diagnose-noasync-in-defer branch May 27, 2024 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calling noasync function inside a defer
2 participants