Skip to content

[6.0][region-isolation] Given a .none #isolation parameter, infer the isolation from the callee rather than the isolated parameter. #74727

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 1 commit into from
Jun 26, 2024

Conversation

gottesmm
Copy link
Contributor

@gottesmm gottesmm commented Jun 26, 2024

Explanation: This PR fixes an issue that affects the usage of functions that use #isolated. The specific problem is that when we call such a function without an actual actor (so we go to the main queue), we improperly infer the isolation of the enum.none to be slightly different from the isolation of other parameters.

The result is that one can get an isolation mismerge that then results in a "unknown pattern" error.

Radars:

  • rdar://130396399

Original PRs:

Risk: Low.
Testing: Added tests to the compiler.
Reviewer: @ktoso

…ation from the callee rather than the isolated parameter.

Otherwise, we will have differing isolation from other parameters since
the isolations will look different since one will have the .none value
as an instance and the other will not have one and instead will rely on
the AST isolation info. That is the correct behavior here since we do
not actually have an actor here.

I also removed some undefined behavior in the merging code. The way the
code should work is that we should check if the merge fails and in such
a case emit an unknown pattern error... instead of not checking
appropriately on the next iteration and hitting undefined behavior.

rdar://130396399
(cherry picked from commit f43911b)
@gottesmm gottesmm requested a review from a team as a code owner June 26, 2024 08:02
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

@gottesmm
Copy link
Contributor Author

@swift-ci test

@gottesmm gottesmm enabled auto-merge June 26, 2024 17:22
@gottesmm gottesmm merged commit ebc8afc into swiftlang:release/6.0 Jun 26, 2024
5 checks passed
@gottesmm gottesmm deleted the release/6.0-rdar130396399 branch June 26, 2024 19:08
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