Skip to content

Concurrency override actor isolation fixes #35270

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

DougGregor
Copy link
Member

Fix a few issues with actor-isolation checking for overrides:

  • Treat the actor isolation of an overridding method as that of its overridden method even if when the overridden method is not isolation, and
  • Allow @asyncHandler overriding declarations to arbitrarily change the actor, because they'll be running the code somewhere else anyway

Infer actor isolation from the overridden declaration unless some other
isolation attribute was explicitly specified directly on that
declaration. This allows type- and extension-level annotations with
a global actor to not break overrides.
…er`.

`@asyncHandler` methods can override with a completely different actor
isolation because they will hop to the appropriate actor themselves.
Therefore, allow differing actor isolation when an `@asyncHandler`
method overrides another method, and don't propagate the actor
isolation from the overridden method to the overriding `@asyncHandler`
method.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

Copy link
Member

@kavon kavon left a comment

Choose a reason for hiding this comment

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

👍🏼

@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

@DougGregor
Copy link
Member Author

@swift-ci please smoke test macOS

Copy link
Contributor

@ktoso ktoso left a comment

Choose a reason for hiding this comment

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

👍

@DougGregor
Copy link
Member Author

@swift-ci please clean smoke test Linux

@DougGregor
Copy link
Member Author

@swift-ci please clean smoke test Windows

@DougGregor
Copy link
Member Author

@swift-ci please clean smoke test macOS

@DougGregor
Copy link
Member Author

@swift-ci please smoke test

1 similar comment
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

@DougGregor
Copy link
Member Author

@swift-ci please smoke test macOS

@DougGregor
Copy link
Member Author

@swift-ci please smoke test Linux

1 similar comment
@DougGregor
Copy link
Member Author

@swift-ci please smoke test Linux

@DougGregor DougGregor merged commit 7d44f6a into swiftlang:main Jan 7, 2021
@DougGregor DougGregor deleted the concurrency-override-actor-isolation-fixes branch January 7, 2021 09:11
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.

3 participants