Skip to content
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

stdlib: Adopt ExtensionImportVisibility experimental feature #72871

Merged
merged 4 commits into from
Apr 5, 2024

Conversation

tshortli
Copy link
Contributor

@tshortli tshortli commented Apr 5, 2024

Adopt the ExtensionImportVisibility feature when building the all standard library modules so that we're dogfooding the feature. Not very surprisingly, given their low dependency footprint, this has no effect on the sources of any of the stdlib modules.

Also, round out the test coverage for ExtensionImportVisibility by adding Obj-C interop tests and specifically testing AnyObject lookup. It turns out that AnyObject already filters out extension/category members that were not directly imported so the flag has no effect on it. We could potentially improve the diagnostics for AnyObject lookup misses that could be fixed by adding an import but that seems like a nice-to-have improvement we can do later.

tshortli added 4 commits April 5, 2024 09:22
This didn't expose any missing imports in the sources of any of the standard
library modules, but that's not entirely surprising. Still, we should have the
feature enabled to test it and prevent regressions from creeping in before the
behavior becomes the default.

Exclude `ExtensionImportVisibility` from module interfaces.
@tshortli tshortli requested a review from DougGregor April 5, 2024 16:28
@tshortli
Copy link
Contributor Author

tshortli commented Apr 5, 2024

@swift-ci please smoke test

@@ -367,7 +367,7 @@ CONDITIONALLY_SUPPRESSIBLE_EXPERIMENTAL_FEATURE(IsolatedAny, true)


// Whether members of extensions respect the enclosing file's imports.
EXPERIMENTAL_FEATURE(ExtensionImportVisibility, true)
EXPERIMENTAL_FEATURE_EXCLUDED_FROM_MODULE_INTERFACE(ExtensionImportVisibility, true)
Copy link
Member

Choose a reason for hiding this comment

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

TIL

@tshortli tshortli marked this pull request as ready for review April 5, 2024 17:21
@tshortli tshortli requested a review from a team as a code owner April 5, 2024 17:21
@tshortli tshortli merged commit da3c12e into swiftlang:main Apr 5, 2024
3 checks passed
@tshortli tshortli deleted the extension-import-visibility branch April 5, 2024 21:41
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