Commit 095de879 authored by Rémy Oudompheng's avatar Rémy Oudompheng

cmd/gc: add missing dupok flag for interface method wrappers.

R=rsc
CC=golang-codereviews
https://golang.org/cl/48420044
parent 9a7fb683
......@@ -2591,8 +2591,10 @@ genwrapper(Type *rcvr, Type *method, Sym *newnam, int iface)
funcbody(fn);
curfn = fn;
// wrappers where T is anonymous (struct{ NamedType }) can be duplicated.
if(rcvr->etype == TSTRUCT || isptr[rcvr->etype] && rcvr->type->etype == TSTRUCT)
// wrappers where T is anonymous (struct or interface) can be duplicated.
if(rcvr->etype == TSTRUCT ||
rcvr->etype == TINTER ||
isptr[rcvr->etype] && rcvr->type->etype == TSTRUCT)
fn->dupok = 1;
typecheck(&fn, Etop);
typechecklist(fn->nbody, Etop);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment