Skip to content

Conversation

@xedin
Copy link
Contributor

@xedin xedin commented Jun 7, 2025

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

…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.
@xedin
Copy link
Contributor Author

xedin commented Jun 12, 2025

@swift-ci please test

…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
@xedin
Copy link
Contributor Author

xedin commented Jun 12, 2025

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented Jun 12, 2025

@swift-ci please test macOS platform

@xedin
Copy link
Contributor Author

xedin commented Jun 19, 2025

@swift-ci please smoke test

@xedin
Copy link
Contributor Author

xedin commented Jun 19, 2025

@swift-ci please smoke test Linux platform

1 similar comment
@xedin
Copy link
Contributor Author

xedin commented Jun 20, 2025

@swift-ci please smoke test Linux platform

@xedin
Copy link
Contributor Author

xedin commented Jun 23, 2025

@swift-ci please smoke test macOS platform

4 similar comments
@xedin
Copy link
Contributor Author

xedin commented Jun 25, 2025

@swift-ci please smoke test macOS platform

@xedin
Copy link
Contributor Author

xedin commented Jun 25, 2025

@swift-ci please smoke test macOS platform

@xedin
Copy link
Contributor Author

xedin commented Jun 25, 2025

@swift-ci please smoke test macOS platform

@xedin
Copy link
Contributor Author

xedin commented Jun 26, 2025

@swift-ci please smoke test macOS platform

@xedin xedin merged commit 32a0d80 into swiftlang:main Jun 26, 2025
5 checks passed
xedin added a commit to xedin/swift that referenced this pull request Jul 1, 2025
…s of imported APIs should match

This is a follow-up to swiftlang#82085
which made it so async variant doesn't get `@Sendable` inferred because
the proposal specified that inference should happen only on completion
handler parameter type of a synchronous variant of an imported API.

This runs into implementation issues related to thunking in some
cases were async convention expects the type of a completion handler
to match exactly for both variants of the imported API.

Resolves: rdar://154695053
xedin added a commit to xedin/swift that referenced this pull request Jul 1, 2025
…s of imported APIs should match

This is a follow-up to swiftlang#82085
which made it so async variant doesn't get `@Sendable` inferred because
the proposal specified that inference should happen only on completion
handler parameter type of a synchronous variant of an imported API.

This runs into implementation issues related to thunking in some
cases were async convention expects the type of a completion handler
to match exactly for both variants of the imported API.

Resolves: rdar://154695053
(cherry picked from commit 30f0fa8)
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