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: empty PkgPath for embedded, unexported struct field #7247

Closed
mwhudson opened this issue Feb 2, 2014 · 13 comments
Closed

cmd/compile: empty PkgPath for embedded, unexported struct field #7247

mwhudson opened this issue Feb 2, 2014 · 13 comments

Comments

@mwhudson
Copy link
Contributor

mwhudson commented Feb 2, 2014

What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. Run this program: http://play.golang.org/p/auHCDnfiG5

What is the expected output?

I am not sure!

What do you see instead?

With the gc toolchain, I see "", with gccgo I see "main"


Which compiler are you using (5g, 6g, 8g, gccgo)?

6g and gccgo

Which operating system are you using?

Ubuntu Saucy

Which version are you using?  (run 'go version')

go 1.1.2 or devel +7abe32ccffb1
gccgo 4.8 and 4.9

Please provide any additional information below.

This affects the tests of the launchpad.net/goyaml package.
@ianlancetaylor
Copy link
Contributor

Comment 1:

I'm pretty sure this is a bug in the gc compiler.  An unexported name should not have an
empty PkgPath.

Labels changed: added repo-main, release-go1.3.

Status changed to Accepted.

@paranoiacblack
Copy link
Contributor

Comment 2:

This was fixed in https://code.google.com/p/go/source/detail?r=6c0339d94123.

@ianlancetaylor
Copy link
Contributor

Comment 3:

Status changed to Fixed.

@rogpeppe
Copy link
Contributor

Comment 4:

Still doesn't seem to be fixed. Confirmed the bug is still there
in 21478:7d6cfbf20970.

Labels changed: added release-go1.4, removed release-go1.3.

Status changed to Accepted.

@rogpeppe
Copy link
Contributor

Comment 5:

For the record, this prints an empty PkgPath:
    http://play.golang.org/p/5YqvyuKXDb

@rsc
Copy link
Contributor

rsc commented Oct 15, 2014

Comment 6:

Rolled back. See issue #7522. Not touching this for Go 1.4

Labels changed: added release-go1.5, removed release-go1.4.

@bradfitz bradfitz modified the milestone: Go1.5 Dec 16, 2014
@rsc rsc removed accepted labels Apr 14, 2015
@rsc rsc modified the milestones: Unplanned, Go1.5 May 19, 2015
@rsc rsc changed the title cmd/gc: empty PkgPath for embedded, unexported struct field cmd/compile: empty PkgPath for embedded, unexported struct field Jun 8, 2015
@mwhudson
Copy link
Contributor Author

I presume #12367 will address this too so maybe this can be closed now?

@gopherbot
Copy link

CL https://golang.org/cl/14010 mentions this issue.

@mpvl
Copy link
Contributor

mpvl commented Aug 31, 2015

@mwhudson yes, it will address it. CL 14010 14085 mention this Issue and it will be automatically closed as soon as 14085 is checked in. The bulk of the issues will go once 14010-2 are checked in. CL 14085 will lock down gc. We need to wait a bit for that to allow package writers to fix their handling of embedded unexported structs.

@gopherbot
Copy link

CL https://golang.org/cl/14085 mentions this issue.

@laboger
Copy link
Contributor

laboger commented Oct 1, 2015

Any update on this, in particular when the fix for gccgo might get merged?

@mpvl
Copy link
Contributor

mpvl commented Oct 1, 2015

@laboger: I'm waiting on Russ' review. As soon as 14010 and the accompanying changes for JSON and XML are checked in, it will be fixed.

The fix for gc will come in after everybody has had a chance to adopt their
reflect code to use PkgPath correctly.

On Thu, Oct 1, 2015 at 4:38 PM, laboger notifications@github.com wrote:

Any update on this, in particular when the fix for gccgo might get merged?


Reply to this email directly or view it on GitHub
#7247 (comment).

mpvl added a commit that referenced this issue Oct 26, 2015
This CL changes reflect to allow access to exported fields and
methods in unexported embedded structs for gccgo and after gc
has been adjusted to disallow access to embedded unexported structs.

Adresses #12367, #7363, #11007, and #7247.

Change-Id: If80536eab35abcd25300d8ddc2d27d5c42d7e78e
Reviewed-on: https://go-review.googlesource.com/14010
Reviewed-by: Russ Cox <rsc@golang.org>
@mpvl mpvl self-assigned this Oct 26, 2015
@mpvl
Copy link
Contributor

mpvl commented Oct 26, 2015

The "fixes" for gccgo have gone in. Or more precisely, the reflect library is now loosened up and xml and json are adjusted to make use of the new semantics.

After the dust is settled, gc will be locked up in the same way as gccgo, after which the two should be fully compatible. Please let me know if you have any problems with gccgo.

@mpvl mpvl closed this as completed in afe9837 Oct 26, 2015
@golang golang locked and limited conversation to collaborators Oct 26, 2016
@rsc rsc unassigned mpvl Jun 23, 2022
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

9 participants