was copying a bit too much about t into n,
like whether the signature was queued to be printed.
(bug reported by anton)
was also editing t, meaning you could do
type T int;
func (p int) Meth() { }
both fixed.
R=ken
OCL=27052
CL=27052
updatetype(Type *n, Type *t)
{
Sym *s;
+ int local;
s = n->sym;
if(s == S || s->otype != n)
fatal("updatetype %T / %T", n, t);
}
- if(n->local)
- t->local = 1;
+ // decl was
+ // type n t;
+ // copy t, but then zero out state associated with t
+ // that is no longer associated with n.
+ local = n->local;
*n = *t;
n->sym = s;
+ n->local = local;
+ n->siggen = 0;
+ n->methptr = 0;
+ n->printed = 0;
+ n->method = nil;
+ n->vargen = 0;
// catch declaration of incomplete type
switch(n->etype) {
t = d->dtype;
et = t->etype;
s = signame(t);
+//print("signame %S for %T\n", s, t);
if(s == S)
continue;
ss->oname->class = PEXTERN;
}
+//print("siggen %T %d\n", t, t->siggen);
if(!t->siggen) {
-//print("siggen %T\n", t);
// special case: don't generate the empty interface
if(strcmp(buf, "empty") == 0)
goto out;