Skip to content

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