From a4b8241d97fb180e1b9cb41c4828345c931d1aaf Mon Sep 17 00:00:00 2001 From: Dan Scales Date: Fri, 2 Apr 2021 16:52:58 -0700 Subject: cmd/compile: get rid of Fields in types.Interface, use allMethods in types.Type instead Confusingly, the set of all methods of an interface is currently set in Fields field of types.Interface. This is true, even though there is already an allMethods field (and AllMethods method) of types.Type. Change so the set of all methods of an interface are stored in Type.allMethods, and Interface.Fields is removed. Update the comments for Methods and AllMethods. Change-Id: Ibc32bafae86831cba62606b079a855690612c759 Reviewed-on: https://go-review.googlesource.com/c/go/+/307209 Run-TryBot: Dan Scales TryBot-Result: Go Bot Trust: Dan Scales Reviewed-by: Matthew Dempsky --- src/cmd/compile/internal/reflectdata/reflect.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/cmd/compile/internal/reflectdata/reflect.go') diff --git a/src/cmd/compile/internal/reflectdata/reflect.go b/src/cmd/compile/internal/reflectdata/reflect.go index c1cded826c..3a31e3c951 100644 --- a/src/cmd/compile/internal/reflectdata/reflect.go +++ b/src/cmd/compile/internal/reflectdata/reflect.go @@ -364,7 +364,7 @@ func methods(t *types.Type) []*typeSig { // imethods returns the methods of the interface type t, sorted by name. func imethods(t *types.Type) []*typeSig { var methods []*typeSig - for _, f := range t.Fields().Slice() { + for _, f := range t.AllMethods().Slice() { if f.Type.Kind() != types.TFUNC || f.Sym == nil { continue } -- cgit v1.2.3-54-g00ecf