-
Notifications
You must be signed in to change notification settings - Fork 18k
x/tools/go/analysis: Pass.All{Package,Object}Facts: document what "all" means #70351
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
Comments
I am the new to this repo. I can work on it, Can someone help to fix this? |
Sure, thanks! You can send the CL to me. |
A challenge to defining "all" is to find a pithy way to describe golang.org/x/tools/go/types/objectpath. That has a large practical influence on "all". FWIW there are some existing disagreements between Analysis runners #47725 . |
Why is that necessary? The set of exported symbols of a package is independent of however we name them. |
The Facts for imported packages are in practice controlled by a mixture of objectpath and the runner (at least this used to be true). If you are trying to determine what "all" means in practice today, it seems like a good place to start. This may converge to something like "the set of exported symbols of a package" for imports. |
The goal is not to describe the exact details of one implementation, but the contract between the analyzer and the driver. Here's what I had in mind:
|
That seems good. (Though it may imply we have some bugs today.) Quick nit: |
"Includes all" implies only a lower bound, so neither wording requires us to implement such a check. |
@adonovan @timothy-king CL is open as I saw no activity from @ninad-k. |
Change https://go.dev/cl/638278 mentions this issue: |
What does "all" mean exactly? I think the intent is that it means the set of facts that you would get if you were to call
ImportObjectFact
on everytypes.Object
that you are able to obtain from the Pass (and mutatis mutandi for s/Object/Package/g).More generally the API is unclear as to whether Export(o, f) followed by Import(o) returns f even within the same package. I think the implementations have always done so.
The text was updated successfully, but these errors were encountered: