a = nil;
o = 0;
oldlist = nil;
- for(f=mt->method; f; f=f->down) {
+ for(f=mt->xmethod; f; f=f->down) {
if(f->type->etype != TFUNC)
continue;
if(f->etype != TFIELD)
// this is not an embedded pointer inside a struct,
// method does not apply.
this = getthisx(f->type)->type->type;
+ if(isptr[this->etype] && this->type == t)
+ continue;
if(isptr[this->etype] && !isptr[t->etype]
&& f->embedded != 2 && !isifacemethod(f))
continue;
if(!eqtype(this, t)) {
if(oldlist == nil)
oldlist = pc;
- if(isptr[it->etype] && isptr[this->etype]
+ if(isptr[t->etype] && isptr[this->etype]
&& f->embedded && !isifacemethod(f))
genembedtramp(t, f, a->tsym);
else
if(s == S)
return;
- if(t == T)
+ if(t == T || t->xmethod != nil)
return;
// generate all reachable methods
}
}
+ t->xmethod = t->method;
for(sl=slist; sl!=nil; sl=sl->link) {
if(sl->good) {
// add it to the base type method list
f->embedded = 1; // needs a trampoline
if(sl->followptr)
f->embedded = 2;
- f->down = t->method;
- t->method = f;
+ f->down = t->xmethod;
+ t->xmethod = f;
}
}