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

cmd/compile: bad reflect.StructField.PkgPath for embedding builtin types #21702

Closed
mdempsky opened this issue Aug 30, 2017 · 5 comments
Closed
Milestone

Comments

@mdempsky
Copy link
Member

https://play.golang.org/p/FKRrIM2rDh

The PkgPath field for embedding the universal "error" type is being set to "go.builtin". It should be "main".

Related to #21696.

@mdempsky mdempsky changed the title reflect: bad reflect.StructField.PkgPath for embedded "error" field reflect: bad reflect.StructField.PkgPath for embedding builtin types Aug 30, 2017
@mdempsky mdempsky changed the title reflect: bad reflect.StructField.PkgPath for embedding builtin types cmd/compile: bad reflect.StructField.PkgPath for embedding builtin types Aug 30, 2017
@mdempsky
Copy link
Member Author

Actually, this applies to all builtin types, not just error.

@gopherbot
Copy link

Change https://golang.org/cl/60410 mentions this issue: cmd/compile: fix and improve struct field reflect information

@dsnet
Copy link
Member

dsnet commented Aug 30, 2017

I think this is a duplicate of #21122

@mdempsky
Copy link
Member Author

@dsnet Certainly related at least. CL 60410 changes S1.x's PkgPath from "" to "main".

@dsnet
Copy link
Member

dsnet commented Aug 30, 2017

Ah, you're right. Definitely related, but different. Lot's subtleties around StructField.PkgPath it seems...

@dsnet dsnet added this to the Go1.10 milestone Sep 1, 2017
@golang golang locked and limited conversation to collaborators Sep 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants