Skip to content

[Concurrency] Downgrade newly diagnosed distributed actor isolation violation as a warning until Swift 6. #71893

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 Feb 26, 2024

In compiler versions <=5.10, the compiler did not diagnose cases where a non-isolated distributed actor value was passed to a VarDecl with a function type type that has an isolated distributed actor parameter, e.g. (isolated DA) -> Void. This code is problematic because the actor value is not known to be local, so only distributed functions may be called on it. This change stages in the error as a warning until Swift 6.

Resolves: rdar://123536432

as a warning until swift 6.

In compiler versions <=5.10, the compiler did not diagnose cases
where a non-isolated distributed actor value was passed to a VarDecl
with a function type type that has an isolated distributed actor
parameter, e.g. `(isolated DA) -> Void`. Stage in the error as a
warning until Swift 6.
@hborla
Copy link
Member Author

hborla commented Feb 26, 2024

@swift-ci please smoke test

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.

Lgtm thank you, yes jumping to an isolated da like this would be unsafe.

@hborla
Copy link
Member Author

hborla commented Feb 26, 2024

@swift-ci please smoke test macOS

@hborla hborla merged commit bb6de77 into swiftlang:main Feb 27, 2024
@hborla hborla deleted the downgrade-distributed-actor-isolation-error branch February 27, 2024 01:19
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.

2 participants