mirror of
https://github.com/golang/go
synced 2024-11-12 10:00:25 -07:00
do not use fake names on anonymous function return values
R=ken OCL=17679 CL=17679
This commit is contained in:
parent
6fecb76eea
commit
ad48706a24
@ -1002,10 +1002,8 @@ naddr(Node *n, Addr *a)
|
||||
a->etype = n->etype;
|
||||
a->offset = n->xoffset;
|
||||
a->sym = n->sym;
|
||||
if(a->sym == S) {
|
||||
if(a->sym == S)
|
||||
a->sym = lookup(".noname");
|
||||
fatal("noname");
|
||||
}
|
||||
if(n->method) {
|
||||
if(n->type != T)
|
||||
if(n->type->sym != S)
|
||||
|
@ -472,12 +472,8 @@ loop:
|
||||
if(n->left != N && n->left->op == ONAME) {
|
||||
f->nname = n->left;
|
||||
f->embedded = n->embedded;
|
||||
} else {
|
||||
vargen++;
|
||||
snprint(buf, sizeof(buf), "_e%s_%.3ld", filename, vargen);
|
||||
f->nname = newname(lookup(buf));
|
||||
f->sym = f->nname->sym;
|
||||
}
|
||||
f->sym = f->nname->sym;
|
||||
|
||||
*t = f;
|
||||
t = &f->down;
|
||||
|
@ -1061,7 +1061,7 @@ Tpretty(Fmt *fp, Type *t)
|
||||
return fmtprint(fp, " }");
|
||||
|
||||
case TFIELD:
|
||||
if(t->sym == S || t->sym->name[0] == '_' || t->embedded) {
|
||||
if(t->sym == S || t->embedded) {
|
||||
if(exporting)
|
||||
fmtprint(fp, "? ");
|
||||
return fmtprint(fp, "%T", t->type);
|
||||
|
Loading…
Reference in New Issue
Block a user