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

[6.0] Implement proper visibility rules for imported extensions #72974

Merged
merged 9 commits into from Apr 11, 2024

Conversation

tshortli
Copy link
Contributor

@tshortli tshortli commented Apr 11, 2024

DougGregor and others added 9 commits April 10, 2024 21:22
If an extension isn't imported either directly or via a transitive
(`@_exported`) import, its members should not be visible to name
lookup. Implement this behavior behind the experimental flag
ExtensionImportVisibility.
This eliminates some diagnostics that incorrectly refer to a missin
`@_spi` import as an outright missing import, which is incorrect. The
one test case changed here really is a case of a missing import that
happens to be SPI.
To prevent performance regressions from calling `findImport()` more frequently,
request-ify the computation.

NFC.

Prerequisite of rdar://16154294
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 a team as a code owner April 11, 2024 04:27
@tshortli
Copy link
Contributor Author

@swift-ci please test

@tshortli tshortli enabled auto-merge April 11, 2024 05:29
@tshortli tshortli merged commit 4ed6ffe into apple:release/6.0 Apr 11, 2024
5 checks passed
@tshortli tshortli deleted the extension-import-visibility-6.0 branch April 11, 2024 15:17
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.

None yet

3 participants