Skip to content

[Concurrency] Don't infer actor isolation from inherited conformances. #75122

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

Conversation

hborla
Copy link
Member

@hborla hborla commented Jul 10, 2024

If a conformance is inherited from a superclass, the isolation of the subclass should be inferred directly from the superclass. If the superclass has opted out of global actor inference from a protocol, such as by conforming to the protocol in an extension, then the subclass should not infer isolation from the protocol.

Resolves: #74274, rdar://129540677

If a conformance is inherited from a superclass, the isolation
of the subclass should be inferred directly from the superclass.
If the superclass has opted out of global actor inference from a
protocol, such as by conforming to the protocol in an extension,
then the subclass should not infer isolation from the protocol.
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.

Patch LGTM, but I do think we need to do some follow up work on documenting the "opt out" behavior in language guide.

@hborla
Copy link
Member Author

hborla commented Jul 10, 2024

@swift-ci please smoke test

@hborla
Copy link
Member Author

hborla commented Jul 10, 2024

@swift-ci please test source compatibiliity

@hborla hborla merged commit 5bddd98 into swiftlang:main Jul 10, 2024
3 checks passed
@hborla hborla deleted the isolation-inference-inherited-conformance branch July 10, 2024 19:01
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.

Swift Compiler bug with MainActor isolation check
2 participants