Skip to content

Sema: Fix getPublicModuleName to look only at loaded modules #76410

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
Sep 12, 2024

Conversation

xymus
Copy link
Contributor

@xymus xymus commented Sep 11, 2024

When onlyIfImported is true, we should return the public module name only when the public facing module is already imported. Replace the call to getModuleByIdentifier with getLoadedModule to prevent loading that module if it wasn't already loaded.

Fix the broken test where the CHECK line was matching itself from the context shown by the Swift style diagnostics.

Fixup for #76269

When onlyIfImported is true, we should return the public module name
only when the public facing module is already imported. Replace the
call to getModuleByIdentifier with getLoadedModule to prevent trigering
loading that module.

Also fix the test where the CHECK lined ended up matching itself from
the diagnostics output.
@xymus
Copy link
Contributor Author

xymus commented Sep 11, 2024

@swift-ci Please smoke test

@xymus
Copy link
Contributor Author

xymus commented Sep 11, 2024

@swift-ci Please smoke test macOS

@xymus xymus merged commit ad94d55 into swiftlang:main Sep 12, 2024
3 checks passed
@xymus xymus deleted the public-module-name-fix-loaded branch September 12, 2024 15:27
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