Skip to content
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

[Concurrency] Propagation and consistency checking for actor constraints. #34301

Merged

Conversation

DougGregor
Copy link
Member

Implement propagation rules for global actor constraints, which can come from:

  • Enclosing extension or type
  • Superclass of a class
  • Overridden declaration
  • Requirement witnessed by a declaration
  • Storage declaration for an accessor

and check actor isolation consistency for overrides and subclasses, which is particularly important when they can't be inferred. Both overriding declarations and subclasses must have the same actor isolation as their overridden declarations or superclasses, respectively. Enforce this, ensuring that we're also doing the appropriate substitutions.

Implement propagation rules for global actor constraints, which can come from:

* Enclosing extension or type
* Superclass of a class
* Overridden declaration
* Requirement witnessed by a declaration
* Storage declaration for an accessor
ActorIsolation is rendered as a descriptive phrase before an entity,
e.g, "actor-independent" or "global actor 'UIActor'-isolated" when
used in diagnostics.
…asses.

Both overriding declarations and subclasses must have the actor
isolation as their overridden declarations or superclasses,
respectively. Enforce this, ensuring that we're also doing the
appropriate substitutions.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor
Copy link
Member Author

@swift-ci please test source compatibility

Subclasses inherit the global actor from their superclass by default,
but it's okay to change it---it's just a default that can be
overridden on a per-member basis anyway.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor
Copy link
Member Author

@swift-ci smoke test

@DougGregor
Copy link
Member Author

@swift-ci test source compatibility

@DougGregor DougGregor merged commit db8402f into swiftlang:main Oct 14, 2020
@DougGregor DougGregor deleted the concurrency-actor-constraint-inference branch October 14, 2020 14:48
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.

None yet

1 participant