aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/noder/decl.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/compile/internal/noder/decl.go')
-rw-r--r--src/cmd/compile/internal/noder/decl.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/noder/decl.go b/src/cmd/compile/internal/noder/decl.go
index cec31d87b7..6b55ce1453 100644
--- a/src/cmd/compile/internal/noder/decl.go
+++ b/src/cmd/compile/internal/noder/decl.go
@@ -104,6 +104,12 @@ func (g *irgen) funcDecl(out *ir.Nodes, decl *syntax.FuncDecl) {
// the Fields to represent the receiver's method set.
if recv := fn.Type().Recv(); recv != nil {
typ := types.ReceiverBaseType(recv.Type)
+ if typ.OrigSym != nil {
+ // For a generic method, we mark the methods on the
+ // base generic type, since those are the methods
+ // that will be stenciled.
+ typ = typ.OrigSym.Def.Type()
+ }
meth := typecheck.Lookdot1(fn, typecheck.Lookup(decl.Name.Value), typ, typ.Methods(), 0)
meth.SetNointerface(true)
}