Skip to content

[6.0] Properly handle @objc thunks for generic classes and actors #74396

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
merged 1 commit into from
Jun 13, 2024

Conversation

rjmccall
Copy link
Contributor

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's isa 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 contexts
Issue: rdar://129187133
Original PR: #74375
Risk: Low
Testing: added new regression tests
Reviewer: Slava Pestov

@rjmccall rjmccall requested a review from a team as a code owner June 13, 2024 17:06
@rjmccall
Copy link
Contributor Author

@swift-ci Please test

@rjmccall rjmccall merged commit b15adc5 into swiftlang:release/6.0 Jun 13, 2024
5 checks passed
@rjmccall rjmccall deleted the generic-objc-thunks-6.0 branch June 13, 2024 23:27
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