Skip to content

AST: Fix ExistentialLayout::isObjC() handling of marker protocols [5.10] #70512

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

Conversation

slavapestov
Copy link
Contributor

  • Description: We would sometimes treat any Sendable as an Objective-C existential, when it is really an opaque existential. This PR fixes the relevant predicate, adds an assertion in SIL type lowering to guard against this bug re-appearing in the future, and changes Objective-C header generation to treat any Sendable the same as Any, that is bridging it to the id type in Objective-C.

  • Origination: It's a recent regression from [5.10][AST/TypeChecker] Allow existential values of Sendable be used from Objective-C #69540 which never shipped in a release.

  • Scope of the issue: The regression caused a miscompile when optimizations were enabled.

  • Radar: rdar://problem/119541554.

  • Reviewed by: @xedin

@slavapestov slavapestov requested a review from a team as a code owner December 16, 2023 17:22
@slavapestov slavapestov changed the title AST: Fix ExistentialLayout::isObjC() handling of marker protocols AST: Fix ExistentialLayout::isObjC() handling of marker protocols [5.10] Dec 16, 2023
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov slavapestov merged commit bc2e025 into swiftlang:release/5.10 Dec 17, 2023
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