Skip to content

[Actor inference] Extend global actor inference #36644

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 3 commits into from
Mar 31, 2021

Conversation

DougGregor
Copy link
Member

Extend global actor inference in a few ways:

  • All value members of a type that has a global actor will infer a global actor, including initializers and static variables
  • A type can infer a global actor from conformance to a protocol that is marked with a global actor

Addresses rdar://75992299

Rather than restricting inference of global actors to instance members,
as we do for actor types, infer global actors for all value members,
which also includes static variables and methods, initializers, and
destructors.
If a protocol is stated to be part of a global actor, infer that a type
that conforms to a protocol in its original definition is also part of
that global actor.

Addresses rdar://75992299.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor
Copy link
Member Author

@swift-ci please smoke test Linux

@DougGregor DougGregor merged commit 46f167b into swiftlang:main Mar 31, 2021
@DougGregor DougGregor deleted the further-global-actor-inference branch March 31, 2021 06:14
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.

1 participant