Skip to content

[6.2][TypeChecker] Remove @_inheritActorContext effect from synchronous types #82209

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 13, 2025

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Jun 12, 2025

Cherry-pick of #82157


  • Explanation:

    The compiler would previously accept use of @_inheritActorContext on a parameter with a synchronous function type which wasn't marked as @isolated(any). That is incorrect because in such cases the attribute has no effect and furthermore would prevent Sendable and isolation checking.

    Uses like that are currently diagnosed by the type-checker but we need to go one step further and remove the effect in such case to prevent invalid uses.

  • Resolves: rdar://143581268

  • Main Branch PR: [TypeChecker] Remove @_inheritActorContext effect from synchronous … #82157

  • Risk: Low/Medium. It's possible that some uses of APIs that use @_inheritActorContext incorrectly are now going to be diagnosed as errors.

  • Reviewed By: @hborla @ktoso

  • Testing: Added new test-cases to the test suite.

(cherry picked from commit dbe19b6)

…types

The compiler would previously accept use of `@_inheritActorContext`
on a parameter with a synchronous function type which wasn't marked
as `@isolated(any)`. That is incorrect because in such cases the
attribute has no effect and furthermore would prevent Sendable
and isolation checking.

Uses like that are currently diagnosed by the type-checker but we
need to go one step further and remove the effect in such case to
prevent invalid uses.

Resolves: rdar://143581268
(cherry picked from commit dbe19b6)
@xedin xedin requested a review from a team as a code owner June 12, 2025 16:07
@xedin xedin added 🍒 release cherry pick Flag: Release branch cherry picks swift 6.2 labels Jun 12, 2025
@xedin
Copy link
Contributor Author

xedin commented Jun 12, 2025

@swift-ci please test

@xedin xedin merged commit fe2db95 into swiftlang:release/6.2 Jun 13, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 6.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants