Skip to content

[Concurrency] Never apply default main actor isolation to local declarations. #83166

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

Closed
wants to merge 1 commit into from

Conversation

hborla
Copy link
Member

@hborla hborla commented Jul 18, 2025

Otherwise, code like this mysteriously fails in -default-isolation MainActor (in this case, because the group parameter is accidentally inferred as @MainActor):

func example() async {
  await withTaskGroup { group in
    group.addTask {}
    await group.next() // error
  }
}

Resolves: rdar://153561279

@hborla
Copy link
Member Author

hborla commented Jul 18, 2025

@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.

Ouch, good catch lgtm

@hborla
Copy link
Member Author

hborla commented Jul 23, 2025

Closing in favor of #83175

@hborla hborla closed this Jul 23, 2025
@hborla hborla deleted the local-decl-isolation branch July 23, 2025 18:14
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.

4 participants