]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/types: add Pkg and SetPkg methods to Type
authorMatthew Dempsky <mdempsky@google.com>
Tue, 17 Apr 2018 21:54:42 +0000 (14:54 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 24 Apr 2018 00:48:29 +0000 (00:48 +0000)
commit03f546eb60bb8da02ef86264f43d9555e96fcb0b
treeb978d86b96ac0f0028958c52e9acbb1bada91f9c
parentd292f77e95fd9afdbfcfa12c9552d5926cdde8b1
cmd/compile/internal/types: add Pkg and SetPkg methods to Type

The go/types API exposes what package objects were declared in, which
includes struct fields, interface methods, and function parameters.

The compiler implicitly tracks these for non-exported identifiers
(through the Sym's associated Pkg), but exported identifiers always
use localpkg. To simplify identifying this, add an explicit package
field to struct, interface, and function types.

Change-Id: I6adc5dc653e78f058714259845fb3077066eec82
Reviewed-on: https://go-review.googlesource.com/107622
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/compile/internal/types/sizeof_test.go
src/cmd/compile/internal/types/type.go