mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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 <danscales@google.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: Dan Scales <danscales@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
6ed045b365
commit
a4b8241d97
12 changed files with 74 additions and 47 deletions
|
|
@ -568,7 +568,7 @@ func transformMethodExpr(n *ir.SelectorExpr) (res ir.Node) {
|
|||
// Compute the method set for t.
|
||||
var ms *types.Fields
|
||||
if t.IsInterface() {
|
||||
ms = t.Fields()
|
||||
ms = t.AllMethods()
|
||||
} else {
|
||||
mt := types.ReceiverBaseType(t)
|
||||
typecheck.CalcMethods(mt)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue