Skip to content

[6.1] Sema: Prioritize @_exported imports over local non-public imports #78101

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

Conversation

xymus
Copy link
Contributor

@xymus xymus commented Dec 11, 2024

Update the logic selecting the most restrictive import for a given reference to account for @_exported imports from the local module. We should always prioritize @_exported imports from the local module over more restrictive same file imports. Only if an import from the same file is also public we prefer it as it's more useful for diagnostics and generally recommended to locally declare dependencies.

Update the logic selecting the most restrictive import for a given
reference to account for @_exported imports from the local module. We
should always prioritize @_exported imports from the local module over
more restrictive same file imports. Only if an import from the same file
is also public we prefer it as it's more useful for diagnostics and
generally recommended to locally declare dependencies.

Also update the test that was meant to check this configuration to apply
two different variations, one for a module local @_exported and one
relying on the underlying clang module.

rdar://140924031
@xymus xymus requested a review from a team as a code owner December 11, 2024 00:06
@xymus xymus requested a review from nkcsgexi December 11, 2024 00:06
@xymus
Copy link
Contributor Author

xymus commented Dec 11, 2024

@swift-ci Please test

@xymus
Copy link
Contributor Author

xymus commented Dec 11, 2024

@swift-ci Please test Linux

@xymus xymus merged commit e9c368b into swiftlang:release/6.1 Dec 12, 2024
5 checks passed
@xymus xymus deleted the access-level-import-reexports-6.1 branch December 12, 2024 18:38
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