aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types2/sizes.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2021-02-17 16:04:59 -0800
committerRobert Griesemer <gri@golang.org>2021-02-18 20:47:07 +0000
commit5e4da8670b13370392a9195930e3b4bbe5f1944f (patch)
tree8ba0d44ed463401d3976f9cd3ae6047645e04340 /src/cmd/compile/internal/types2/sizes.go
parent5ecb9a788716be799d73c5d8192368ecb9557d48 (diff)
downloadgo-5e4da8670b13370392a9195930e3b4bbe5f1944f.tar.gz
go-5e4da8670b13370392a9195930e3b4bbe5f1944f.zip
[dev.typeparams] cmd/compile/internal/types2: use converter functions rather than methods
This change replaces methods with functions to reduce the API surface of types2.Type and to match the approach taken in go/types. The converter methods for Named and TypeParam will be addressed in a follow-up CL. Also: Fixed behavior of optype to return the underlying type for arguments that are not type parameters. Change-Id: Ia369c796754bc33bbaf0c9c8478badecb729279b Reviewed-on: https://go-review.googlesource.com/c/go/+/293291 Trust: Robert Griesemer <gri@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
Diffstat (limited to 'src/cmd/compile/internal/types2/sizes.go')
-rw-r--r--src/cmd/compile/internal/types2/sizes.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/types2/sizes.go b/src/cmd/compile/internal/types2/sizes.go
index 9945dcd10c..9d8f3ae5ad 100644
--- a/src/cmd/compile/internal/types2/sizes.go
+++ b/src/cmd/compile/internal/types2/sizes.go
@@ -241,7 +241,7 @@ func (conf *Config) offsetsof(T *Struct) []int64 {
func (conf *Config) offsetof(typ Type, index []int) int64 {
var o int64
for _, i := range index {
- s := typ.Struct()
+ s := asStruct(typ)
o += conf.offsetsof(s)[i]
typ = s.fields[i].typ
}