Skip to content

Make objcImpl classes derive inherited inits #63534

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 3 commits into from
Feb 9, 2023

Conversation

beccadax
Copy link
Contributor

@beccadax beccadax commented Feb 9, 2023

A class that uses @objcImplementation but does not explicitly declare any designated initializers previously did not override the superclass initializers, so its stored properties would not be initialized. Opt these classes into that logic and adjust it to add the initializers to the @objcImplementation extension instead of the ClassDecl itself.

This PR also re-enables some tests on macOS that were disabled because they didn't work properly on other platforms.

Reviewers: I recommend reviewing commit-by-commit. The first two commits contain only test changes.

Fixes rdar://105008242.

These were disabled becuase they didn’t work properly in bots testing iOS or other platforms. Re-enable them for macOS until they can be fully repaired.
• Remove dependency on where the `init` selector is emitted.
• Use variable names captured from previous lines instead of assuming specific names.
A class that uses @objcImplementation but does not explicitly declare any designated initializers previously did not override the superclass initializers, so its stored properties would not be initialized. Opt these classes into that logic and adjust it to add the initializers to the @objcImplementation extension instead of the ClassDecl itself.

Fixes rdar://105008242.
@beccadax
Copy link
Contributor Author

beccadax commented Feb 9, 2023

@swift-ci please smoke test

@beccadax beccadax requested a review from DougGregor February 9, 2023 00:08
Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@beccadax beccadax merged commit 7d93b75 into swiftlang:main Feb 9, 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