Skip to content
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

[6.0][Concurrency] Stage in new Async{Throwing}Stream.init(unfolding:) errors as warnings. #73360

Merged
merged 3 commits into from
May 1, 2024

Conversation

hborla
Copy link
Member

@hborla hborla commented May 1, 2024

  • Explanation: Marking the closure parameter to Async{Throwing}Stream.init(unfolding:) as @Sendable changed the inferred isolation of closure arguments in actor-isolated contexts, which caused new effects checker errors when accessing isolated properties and methods without await. Mark these inits as @preconcurrency, and fix the effects checker to downgrade those errors to warnings when the context of the call is @preconcurrency.
  • Scope: Only impacts code calling these initializers in an actor-isolated context.
  • Risk: Low; the only effect of this change is downgrading errors to warnings.
  • Testing: Added new tests.
  • Main branch PR: [Concurrency] Stage in new Async{Throwing}Stream.init(unfolding:) errors as warnings. #73310

…rrors

as warnings.

Marking the closure parameter to these inits as `@Sendable` changed the
inferred isolation of closure arguments in actor-isolated contexts, which
caused new effects checker errors when accessing isolated properties and
methods without `await`. Mark these `init`s as `@preconcurrency`, and fix
the effects checker to downgrade those errors to warnings when the context
of the call is `@preconcurrency`.

(cherry picked from commit 38cc951)
@hborla hborla requested a review from a team as a code owner May 1, 2024 05:17
@hborla
Copy link
Member Author

hborla commented May 1, 2024

@swift-ci please test

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

This is a nice way to stage in this change, thank you!

@hborla hborla merged commit d5e0ca5 into apple:release/6.0 May 1, 2024
5 checks passed
@hborla hborla deleted the 6.0-async-stream-sendable-error branch May 1, 2024 16: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.

None yet

2 participants