Skip to content

Conversation

slavapestov
Copy link
Contributor

  • Description: We introduced a new Clang attribute to bridge Objective-C parameter and return types as 'Sendable', but this wasn't plumbed through, so calling such a method from Swift would pass the address of the Swift existential as id, causing a crash on the Objective-C side. This patch handles this case via the "id as Any" code path, performing the correct bridging.
  • Risk: Low; this generalizes the "isAny()" check in two places to also allow existentials containing only marker protocols.
  • Reviewed by: @DougGregor
  • Radar: Fixes rdar://problem/107264240.

@slavapestov slavapestov requested a review from a team as a code owner April 25, 2023 16:13
Fixes rdar://problem/107264240.
@slavapestov slavapestov force-pushed the bridging-id-as-any-sendable-5.9 branch from fde1ebb to ddce01f Compare April 25, 2023 17:56
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov slavapestov merged commit c2a096b into swiftlang:release/5.9 Apr 26, 2023
@AnthonyLatsis AnthonyLatsis added the 🍒 release cherry pick Flag: Release branch cherry picks label May 3, 2023
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 5.9
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants