Skip to content

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

hborla added 3 commits April 30, 2024 19:23
…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 swiftlang:release/6.0 May 1, 2024
@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.

2 participants