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

x/tools/go/gcexportdata: Write incorrectly handles unexported identifiers that are reexported #44595

Open
mdempsky opened this issue Feb 25, 2021 · 0 comments
Labels
NeedsFix The path to resolution is known, but the work has not been done. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@mdempsky
Copy link
Member

I don't have a standalone repro for this yet, but I'm seeing roughly this issue internally:

package a
type T struct { x int }
package b
import "a"
type T a.T
package c
import "a"
import "b"
var _ = (*b.T)((*a.T)(nil))

This code is valid and accepted by cmd/compile. But typechecking c with go/types will fail if: packages a and b are typechecked with go/loader; their export data is written out with gcexportdata.Write, and then read back in again with gcexportdata.Read; and finally used to typecheck package c.

I seem to remember having to recentlyish fix some import/export issues around selector identifiers like this in the compiler. Those fixes probably just need to be carried over to gcexportdata.

@mdempsky mdempsky added the NeedsFix The path to resolution is known, but the work has not been done. label Feb 25, 2021
@mdempsky mdempsky self-assigned this Feb 25, 2021
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Feb 25, 2021
@gopherbot gopherbot added this to the Unreleased milestone Feb 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix The path to resolution is known, but the work has not been done. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

2 participants