-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/compile: internal compiler error: weird package in name (dev.regabi branch) #43479
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
Labels
Comments
Bisects to CL 274440 for me. |
Thanks for the bisection. |
Change https://golang.org/cl/281292 mentions this issue: |
gopherbot
pushed a commit
that referenced
this issue
Jan 4, 2021
When exporting signature types, we include the originating package, because it's exposed via go/types's API. And as a consistency check, we ensure that the parameter names came from that same package. However, we were getting this wrong in the case of exported variables that were initialized with a method value using an imported method. In this case, when we created the method value wrapper function's type (which is reused as the variable's type if none is explicitly provided in the variable declaration), we were reusing the original (i.e., imported) parameter names, but the newly created signature type was associated with the current package instead. The correct fix here is really to preserve the original signature type's package (along with position and name for its parameters), but that's awkward to do at the moment because the DeclFunc API requires an ir representation of the function signature, whereas we only provide a way to explicitly set packages via the type constructor APIs. As an interim fix, we associate the parameters with the current package, to be consistent with the signature type's package. Fixes #43479. Change-Id: Id45a10f8cf64165c9bc7d9598f0a0ee199a5e752 Reviewed-on: https://go-review.googlesource.com/c/go/+/281292 Trust: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Closing as fixed on |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
No, only on the regabi branch.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Cloned https://github.com/markbates/pkger, built the dev.regabi branch, and did a
go build
in thepkger
checkout.What did you expect to see?
No errors, a built binary.
What did you see instead?
/cc @mdempsky
The text was updated successfully, but these errors were encountered: