-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Disallow async IBAction methods #59205
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
@swift-ci please test |
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.
You have the right idea, but I have some nitpicky requests/suggestions to make.
The IBAction signature does not allow completion handlers, so making IBAction methods async doesn't make sense. Disallowing it statically so it doesn't just break people when they try.
This patch merges the two diagnostics complaining about asynchronous function declarations with incompatible attributes. The two are cdecl and ibaction at the moment.
This adds a note with a possible way to fix the issue, recommending removing the `async` effect and wrapping the body of the function in a task.
d7a97ac
to
103fca9
Compare
@swift-ci please test |
This patch teaches the compiler to emit a fix-it to automatically wrap everything in the function in a Task and remove the effects from the function declaration.
103fca9
to
129b9c0
Compare
@swift-ci please test |
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.
Perfect! Thank you!
@swift-ci please test and merge |
The IBAction signature does not allow completion handlers, so making
IBAction methods async doesn't make sense. Disallowing it statically so
it doesn't just break people when they try.
Resolves: rdar://83259194