-
Notifications
You must be signed in to change notification settings - Fork 18k
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
go/types: Config.Check says Object.Pkg is in the "go/importer" package #13898
Comments
The go version is, "go version go1.5.2 linux/amd64" |
There may be an issue here, but your example is convoluted. For one, it doesn't type-check w/o errors: The source you are providing doesn't define "src". Please simplify the test case. |
Simpler:
|
This is more subtle. The original (shortened) example works correctly if the import order is changed. In other words, the declaration:
leads to:
But the declaration:
(go/types imported before go/importer) leads to the correct output:
|
Complete repro case:
The output is:
But it should be:
|
This is fast! Awesome! |
CL https://golang.org/cl/18549 mentions this issue. |
This is the equivalent of https://golang.org/cl/18549 for the binary importer (which is usually not used because by default the gc compiler produces the traditional textual export format). For #13898. Change-Id: Idb6b515f2ee49e6d0362c71846994b0bd4dae8f7 Reviewed-on: https://go-review.googlesource.com/18598 Reviewed-by: Alan Donovan <adonovan@google.com> Run-TryBot: Robert Griesemer <gri@golang.org>
The output of this program is,
use@main.go:39:24: id=Pkg obj=func (interface).Pkg() *go/types.Package in pkg=go/importer
But this looks wrong. Pkg is a method of the interface types.Object, and its package should be "go/types".
The text was updated successfully, but these errors were encountered: