diff options
author | Keith Randall <khr@golang.org> | 2021-07-23 15:23:57 -0700 |
---|---|---|
committer | Keith Randall <khr@golang.org> | 2021-07-23 23:44:49 +0000 |
commit | 6992dcdad9b94a2b33b957474ef0eb210d563a40 (patch) | |
tree | 41123085276160fca12c71b13dadb03d84d994f7 /src/cmd/compile/internal/reflectdata/reflect.go | |
parent | e6d956e1c521b948257dd20056436d133df176f6 (diff) | |
download | go-6992dcdad9b94a2b33b957474ef0eb210d563a40.tar.gz go-6992dcdad9b94a2b33b957474ef0eb210d563a40.zip |
[dev.typeparams] cmd/compile: fix some issues with cons.go
Add a test to make sure there's no invalid OCONVIFACEs when stenciling is done.
Use concrete types for the type of DOTTYPE and DOTTYPE2.
MarkTypeUsedInInterface - should we allow types with shape types
underneath? I think the itab CL will help with this (at least, for
a remaining cons.go issue).
Change-Id: I2c96d74e8daaca26cadc84ea94abb9a27c0bb240
Reviewed-on: https://go-review.googlesource.com/c/go/+/337069
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, 6 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/reflectdata/reflect.go b/src/cmd/compile/internal/reflectdata/reflect.go index 1391102d0f..875d53b3cc 100644 --- a/src/cmd/compile/internal/reflectdata/reflect.go +++ b/src/cmd/compile/internal/reflectdata/reflect.go @@ -1982,6 +1982,12 @@ var ZeroSize int64 // MarkTypeUsedInInterface marks that type t is converted to an interface. // 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) + } tsym := TypeLinksym(t) // Emit a marker relocation. The linker will know the type is converted // to an interface if "from" is reachable. |