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

Remove the last use of getPackageForFile on symbols #7758

Draft
wants to merge 1 commit into
base: jez-pkg-root-symbol
Choose a base branch
from

Conversation

jez
Copy link
Collaborator

@jez jez commented Mar 12, 2024

Motivation

This is the last place where we were using sym.loc().file() to get the package that owns the symbol, rather than using symbol information to lookup the package directly.

There are still a handful of getPackageNameForFile calls (which get the MangledName for the package instead of the full PackageInfo), and removing all the rest of these should mean that we can remove the part of VisibilityChecker that calls addLoc to ensure that a symbol's canonical loc matches the owning package.

Test plan

See included automated tests.

This is the last place where we were using `sym.loc().file()` to get the
package that owns the symbol, rather than using symbol information to
lookup the package directly.

There are still a handful of `getPackageNameForFile` calls (which get
the `MangledName` for the package instead of the full `PackageInfo`),
and removing all the rest of these should mean that we can remove the
part of `VisibilityChecker` that calls `addLoc` to ensure that a
symbol's canonical loc matches the owning package.
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

1 participant