]> Cypherpunks repositories - gostls13.git/commit
go/types: adjust gcimporter to actual gc export data
authorRobert Griesemer <gri@golang.org>
Wed, 13 Feb 2013 18:21:24 +0000 (10:21 -0800)
committerRobert Griesemer <gri@golang.org>
Wed, 13 Feb 2013 18:21:24 +0000 (10:21 -0800)
commitf6fe3271f738355f73ee79a9c5bc2a881eebd783
tree31548cf0a720f2cb83dd5ba61feac200dea57725
parent4a524311f4d538a2c5a45d56286fdefbd2cf1c7a
go/types: adjust gcimporter to actual gc export data

Unexported field and method names that appear in the
export data (as part of some exported type) are fully
qualified with a package id (path). In some cases, a
package with that id was never exported for any other
use (i.e. only the path is of interest).

We must not create a "real" package in those cases
because we don't have a package name. Entering an
unnamed package into the map of imported packages
makes that package accessible for other imports.
Such a subsequent import may find the unnamed
package in the map, and reuse it. That reused and
imported package is then entered into the importing
file scope, still w/o a name. References to that
package cannot resolved after that. Was bug.

R=adonovan
CC=golang-dev
https://golang.org/cl/7307112
src/pkg/exp/gotype/gotype_test.go
src/pkg/go/types/gcimporter.go
src/pkg/go/types/scope.go
src/pkg/go/types/types.go