Skip to content

Sema: Prioritize @_exported imports over local non-public imports #78005

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 1 commit into from
Dec 9, 2024

Conversation

xymus
Copy link
Contributor

@xymus xymus commented Dec 6, 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.

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 tshortli December 6, 2024 01:03
@xymus
Copy link
Contributor Author

xymus commented Dec 6, 2024

@swift-ci Please smoke test

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 force-pushed the access-level-import-reexports branch from 8cf3e9b to c9d0848 Compare December 6, 2024 17:31
@xymus
Copy link
Contributor Author

xymus commented Dec 6, 2024

@swift-ci Please smoke test

@xymus
Copy link
Contributor Author

xymus commented Dec 6, 2024

@swift-ci Please smoke test Linux

1 similar comment
@xymus
Copy link
Contributor Author

xymus commented Dec 9, 2024

@swift-ci Please smoke test Linux

@xymus xymus merged commit 3d9dc81 into swiftlang:main Dec 9, 2024
3 checks passed
@xymus xymus deleted the access-level-import-reexports branch December 9, 2024 21:35
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