Skip to content

Support class extensions in objcImpl #71445

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 13, 2024
Merged

Conversation

beccadax
Copy link
Contributor

@beccadax beccadax commented Feb 7, 2024

Their requirements are now included when typechecking the main body extension.

Fixes rdar://118535473.

@beccadax
Copy link
Contributor Author

beccadax commented Feb 7, 2024

@swift-ci please test

@beccadax
Copy link
Contributor Author

beccadax commented Feb 8, 2024

@swift-ci please test

@beccadax
Copy link
Contributor Author

beccadax commented Feb 8, 2024

Hmm. On second thought, I bet this needs more work to support conformances...

This reduces the memory overhead of objcImpl from one word per Decl to one bit per Decl, at the cost of making cache lookups slightly slower (but it will only be consulted once for non-objcImpl decls, which is by far the most common case).
An @_objcImpl extension with no category name *should* implement not only the class’s main @interface, but also any class extension @interfaces. Start making this true by making ObjCInterfaceAndImplementationRequest return all of these decls as the interfaces for such an implementation.

This commit doesn’t actually change Sema or IRGen to process the extra interfaces, so it’s NFC.
Their requirements are now included when typechecking the main body extension, and their conformances are emitted in IRGen.

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

@swift-ci please test

@beccadax
Copy link
Contributor Author

@swift-ci please smoke test compiler performance

@beccadax
Copy link
Contributor Author

@swift-ci please test Windows platform

@beccadax
Copy link
Contributor Author

@tshortli Think you could give this a review?

@beccadax beccadax merged commit 7aa5b7f into swiftlang:main Feb 13, 2024
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