[6.0][ClangImporter/SILGen] A couple of fixes for ObjC and Sendable interaction #74575
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.
Explanation:
Fixes a couple of crashers recently discovered when ObjC API have been annotated with
@Sendable
attribute.id-to-Any
should be placed in some pre-allocated buffer, let's not attempt marker existential transformation because that would much the expected layout already.: AnyObject
was added only if there were no other constraints because all of them would imply it before, with introduction ofSendable
this is no longer the case. Let's addAnyObject
constraint unconditionally and let generic signature builder deal with the redundancy.Main Branch PRs: [ClangImporter] Always add
AnyObject
constraint to generic parameters #74492, [SILGen] Fixany Sendable
toAny
bridging when result should be p… #74483Resolves: rdar://127520993
Risk: Low
Reviewed By: @jckarter
Testing: Existing test-cases were modified and new tests were added.