x/tools/go/packages: overlay does not cause ExportFile to be cleared #71098
Labels
Bug
Issues describing a bug in the Go implementation.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
In the
x/tools/go/pacakges
there is a comment, mentioning that overlay might invalidate export data, see:https://github.com/golang/tools/blob/b93274bf6492f1e1ab72ee5def8da5dfbc9e0e43/go/packages/packages.go#L800-L802
It was introduced in CL 151999.
If that is still true, then we should probably also clear the
ExportFile
field, this is currently not being done. But looking at the exported file, it seems to include theTest2
symbol defined in the overlay, so it seems to work. The comment mentions that it can so maybe this might happen only in some other corner-cases (that i am not aware of), if so we should probably clear thatExportFile
.Reproducer (using the
x/tools/go/packages
testing API):CC @matloob @adonovan
The text was updated successfully, but these errors were encountered: