Skip to content

[6.2][ClangImporter] SE-0463: Implement @Sendable inference exception for global actor isolated functions #82536

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 2 commits into from
Jun 27, 2025

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Jun 26, 2025

Cherry-pick of #82085


  • Explanation:

    Functions that are isolated to a global actor don't have completion
    handlers imported as @Sendable. Main actor isolated functions with
    completion handlers that are always called on the main actor is a
    very common Objective-C pattern, and this carve out will eliminate
    false positive warnings in the cases where the main actor annotation
    is missing on the completion handler parameter.

  • Resolves: rdar://149811049

  • Main Branch PR: [ClangImporter] SE-0463: Implement @Sendable inference exception for global actor isolated functions #82085

  • Risk: Low. This is a very narrow change that only affects completion handler parameters of imported ObjC functions that are global actor isolated.

  • Reviewed By: @ktoso

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

xedin added 2 commits June 26, 2025 09:32
…meter

This lifts the check for the feature flag up into the `importParameterType`
from `importType` and means that completion handler type for `async` variant
is no longer gains `@Sendable` attribute.

(cherry picked from commit 74471e8)
…r global actor isolated functions

Functions that are isolated to a global actor don't have completion
handlers imported as `@Sendable`. Main actor isolated functions with
completion handlers that are always called on the main actor is a
very common Objective-C pattern, and this carve out will eliminate
false positive warnings in the cases where the main actor annotation
is missing on the completion handler parameter.

Resolves: rdar://149811049
(cherry picked from commit ab227b4)
@xedin xedin requested a review from a team as a code owner June 26, 2025 16:37
@xedin
Copy link
Contributor Author

xedin commented Jun 26, 2025

@swift-ci please test

@xedin xedin requested a review from bnbarham June 26, 2025 16:37
@xedin
Copy link
Contributor Author

xedin commented Jun 26, 2025

@swift-ci please test macOS platform

1 similar comment
@xedin
Copy link
Contributor Author

xedin commented Jun 26, 2025

@swift-ci please test macOS platform

@xedin xedin merged commit d6254f2 into swiftlang:release/6.2 Jun 27, 2025
5 checks passed
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.

3 participants