summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cmd/gc/subr.c9
-rw-r--r--src/cmd/gc/walk.c4
2 files changed, 13 insertions, 0 deletions
diff --git a/src/cmd/gc/subr.c b/src/cmd/gc/subr.c
index fbfded77c..14a5fa7b5 100644
--- a/src/cmd/gc/subr.c
+++ b/src/cmd/gc/subr.c
@@ -1112,6 +1112,15 @@ Tpretty(Fmt *fp, Type *t)
return fmtprint(fp, " }");
case TSTRUCT:
+ if(t->funarg) {
+ fmtprint(fp, "(");
+ for(t1=t->type; t1!=T; t1=t1->down) {
+ fmtprint(fp, "%T", t1);
+ if(t1->down)
+ fmtprint(fp, ", ");
+ }
+ return fmtprint(fp, ")");
+ }
fmtprint(fp, "struct {");
for(t1=t->type; t1!=T; t1=t1->down) {
fmtprint(fp, " %T", t1);
diff --git a/src/cmd/gc/walk.c b/src/cmd/gc/walk.c
index 2402ef3b6..31b52434a 100644
--- a/src/cmd/gc/walk.c
+++ b/src/cmd/gc/walk.c
@@ -3673,6 +3673,10 @@ old2new(Node *n, Type *t, NodeList **init)
yyerror("left side of := must be a name");
return n;
}
+ if(t != T && t->funarg) {
+ yyerror("use of multi func value as single value in :=");
+ return n;
+ }
l = newname(n->sym);
dodclvar(l, t, init);
return l;