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
Assignees
Milestone

Comments

@mdempsky
Copy link
Member

@mdempsky mdempsky commented Feb 25, 2021

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 self-assigned this 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants