Skip to content

Conversation

@hborla
Copy link
Member

@hborla hborla commented Sep 3, 2023

Adds a few test cases for isolated parameter issues that are now fixed on main:

  • Inheriting actor context within a function that uses an isolated parameter.
  • A non-escaping, synchronous closure used within a function with an isolated parameter.

Resolves #62568, rdar://90849047

@hborla hborla requested review from kavon and ktoso as code owners September 3, 2023 19:24
@hborla
Copy link
Member Author

hborla commented Sep 3, 2023

@swift-ci please smoke test

…ures

used inside a function with an isolated parameter.
@hborla hborla changed the title [NFC][Concurrency] Add a test case for inheriting actor context within a function that uses isolated parameters. [NFC][Concurrency] Add a few test cases for isolated parameters. Sep 3, 2023
@hborla
Copy link
Member Author

hborla commented Sep 3, 2023

@swift-ci please smoke test

task: @escaping @Sendable (isolated ActorType) -> Void)
{
// Compiler correctly allows this task to execute synchronously.
task(isolatedActor)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a bit confusing to call this "task" but code is good 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair, but I copied the test case from #62568

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!

@hborla hborla merged commit 19be770 into swiftlang:main Sep 4, 2023
@hborla hborla deleted the isolated-parameter-test-case branch September 4, 2023 15:43
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.

Task created from a method with an isolated parameter breaks actor isolation

2 participants