[6.0] Properly handle @objc
thunks for generic classes and actors
#74396
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: We were not properly handling generic arguments when emitting SIL for the Objective-C thunk associated with a generic class method. Generic methods are not generally allowed to be exposed to Objective-C, but an exception exists for methods that are only generic because of the type of
self
. It's likely that the mishandling at the SIL level would not cause real problems in simple generated code because the generic arguments are not passed independently in the actual ABI — they're just recovered from the object'sisa
metadata. However, it does cause assertion failures because the SIL is malformed, and it's possible that that could have other compile-time consequences.Scope: Narrow; affects SIL generation of
@objc
method thunks in generic contextsIssue: rdar://129187133
Original PR: #74375
Risk: Low
Testing: added new regression tests
Reviewer: Slava Pestov