]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: use correct packages when exporting/importing _ (blank) names
authorRobert Griesemer <gri@golang.org>
Tue, 3 May 2016 00:03:36 +0000 (17:03 -0700)
committerRobert Griesemer <gri@golang.org>
Tue, 3 May 2016 14:57:06 +0000 (14:57 +0000)
commit15f7a66f3686d24fd5ad233c6c6b1ff22daa42ae
tree88b9fad7f0391351cce645d5f36fe5a3c077535d
parentbabdbfb8260bbe8c6305c9d3023d83cc0b3645bf
cmd/compile: use correct packages when exporting/importing _ (blank) names

1) Blank parameters cannot be accessed so the package doesn't matter.
   Do not export it, and consistently use localpkg when importing a
   blank parameter.

2) More accurately replicate fmt.go and parser.go logic when importing
   a blank struct field. Blank struct fields get exported without
   package qualification.
   (This is actually incorrect, even with the old textual export format,
   but we will fix that in a separate change. See also issue 15514.)

Fixes #15491.

Change-Id: I7978e8de163eb9965964942aee27f13bf94a7c3c
Reviewed-on: https://go-review.googlesource.com/22714
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/bexport.go
src/cmd/compile/internal/gc/bimport.go
src/go/internal/gcimporter/bimport.go