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

Comments

Projects
None yet
3 participants
@mdempsky
Copy link
Member

commented Aug 30, 2017

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

This comment has been minimized.

Copy link
Member Author

commented Aug 30, 2017

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

@gopherbot

This comment has been minimized.

Copy link

commented Aug 30, 2017

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

@dsnet

This comment has been minimized.

Copy link
Member

commented Aug 30, 2017

I think this is a duplicate of #21122

@mdempsky

This comment has been minimized.

Copy link
Member Author

commented Aug 30, 2017

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

@dsnet

This comment has been minimized.

Copy link
Member

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

@gopherbot gopherbot closed this in d349fa2 Sep 5, 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.
You can’t perform that action at this time.