AST: Fix ExistentialLayout::isObjC() handling of marker protocols [5.10] #70512
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 treatany Sendable
the same asAny
, that is bridging it to theid
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