diff options
author | Matthew Dempsky <mdempsky@google.com> | 2018-04-17 14:54:42 -0700 |
---|---|---|
committer | Matthew Dempsky <mdempsky@google.com> | 2018-04-24 00:48:29 +0000 |
commit | 03f546eb60bb8da02ef86264f43d9555e96fcb0b (patch) | |
tree | b978d86b96ac0f0028958c52e9acbb1bada91f9c /src/cmd/compile/internal/types/sizeof_test.go | |
parent | d292f77e95fd9afdbfcfa12c9552d5926cdde8b1 (diff) | |
download | go-03f546eb60bb8da02ef86264f43d9555e96fcb0b.tar.gz go-03f546eb60bb8da02ef86264f43d9555e96fcb0b.zip |
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>
Diffstat (limited to 'src/cmd/compile/internal/types/sizeof_test.go')
-rw-r--r-- | src/cmd/compile/internal/types/sizeof_test.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cmd/compile/internal/types/sizeof_test.go b/src/cmd/compile/internal/types/sizeof_test.go index 04e2f01e92..2633ef2ddd 100644 --- a/src/cmd/compile/internal/types/sizeof_test.go +++ b/src/cmd/compile/internal/types/sizeof_test.go @@ -26,9 +26,9 @@ func TestSizeof(t *testing.T) { {Type{}, 52, 88}, {Map{}, 20, 40}, {Forward{}, 20, 32}, - {Func{}, 28, 48}, - {Struct{}, 12, 24}, - {Interface{}, 4, 8}, + {Func{}, 32, 56}, + {Struct{}, 16, 32}, + {Interface{}, 8, 16}, {Chan{}, 8, 16}, {Array{}, 12, 16}, {DDDField{}, 4, 8}, |