diff options
author | Keith Randall <khr@golang.org> | 2021-07-23 18:10:58 -0700 |
---|---|---|
committer | Keith Randall <khr@golang.org> | 2021-07-24 15:57:01 +0000 |
commit | 77e0bf294cc431d5608c183d56b6aadbb95b09b0 (patch) | |
tree | 0acfce3c498e01a17f73ce5edab40c08fdd9616f /src/cmd/compile/internal/reflectdata/reflect.go | |
parent | 9f928f9318efb9e6a9d45e7ed959afaaee4b7315 (diff) | |
download | go-77e0bf294cc431d5608c183d56b6aadbb95b09b0.tar.gz go-77e0bf294cc431d5608c183d56b6aadbb95b09b0.zip |
[dev.typeparams] cmd/compile: introduce OCONVIDATA op
This operation computes just the data field needed to put its argument
into an interface. Used by generics because we produce the type field
of an interface using dictionaries (instead of statically).
With this operation defined, we can now assert that shape types
are never marked as used in interfaces (the only previous use
was IDATA(CONVIFACE(t))).
Change-Id: Idb1eb5f3b238285cb99413d382599c0621b7681a
Reviewed-on: https://go-review.googlesource.com/c/go/+/337109
Trust: Keith Randall <khr@golang.org>
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
Diffstat (limited to 'src/cmd/compile/internal/reflectdata/reflect.go')
-rw-r--r-- | src/cmd/compile/internal/reflectdata/reflect.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/cmd/compile/internal/reflectdata/reflect.go b/src/cmd/compile/internal/reflectdata/reflect.go index 875d53b3cc..7eba5fb41e 100644 --- a/src/cmd/compile/internal/reflectdata/reflect.go +++ b/src/cmd/compile/internal/reflectdata/reflect.go @@ -1983,10 +1983,8 @@ var ZeroSize int64 // This information is used in the linker in dead method elimination. func MarkTypeUsedInInterface(t *types.Type, from *obj.LSym) { if t.HasShape() { - // TODO: shape types shouldn't be put in interfaces, so we shouldn't ever get here. - // We don't from ../noder/stencil.go, but we do from ../walk/walk.go when we let - // shape types become the types of interfaces. - //base.Fatalf("shape types have no methods %+v", t) + // Shape types shouldn't be put in interfaces, so we shouldn't ever get here. + base.Fatalf("shape types have no methods %+v", t) } tsym := TypeLinksym(t) // Emit a marker relocation. The linker will know the type is converted |