summaryrefslogtreecommitdiff
path: root/src/cmd/gc/export.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2008-10-06 16:44:17 -0700
committerRuss Cox <rsc@golang.org>2008-10-06 16:44:17 -0700
commitc3f883ca269da60d18eeffd32e1827cf85de08c9 (patch)
treead3bc97650aa258d27d9187800c07d45f3661920 /src/cmd/gc/export.c
parent3d805b91f2806b9bc4fe4e55dc74179813ca11e6 (diff)
downloadgolang-c3f883ca269da60d18eeffd32e1827cf85de08c9.tar.gz
change type names to go live at the name, so that
type T struct { next *T } and type T *struct { next T } are valid without needing forward declarations. add "type T struct" syntax for forward struct declarations. add "type T interface" syntax, but commented out (need to fix semicolons first) R=ken DELTA=452 (259 added, 115 deleted, 78 changed) OCL=16580 CL=16584
Diffstat (limited to 'src/cmd/gc/export.c')
-rw-r--r--src/cmd/gc/export.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cmd/gc/export.c b/src/cmd/gc/export.c
index b3d3556de..8a6d779be 100644
--- a/src/cmd/gc/export.c
+++ b/src/cmd/gc/export.c
@@ -300,6 +300,7 @@ importvar(int export, Node *ss, Type *t)
warn("redeclare import var %S from %T to %T",
s, s->oname->type, t);
}
+ checkwidth(t);
addvar(newname(s), t, PEXTERN);
if(debug['e'])
@@ -325,6 +326,7 @@ importtype(int export, Node *ss, Type *t)
s->otype = typ(0);
*s->otype = *t;
s->otype->sym = s;
+ checkwidth(s->otype);
if(debug['e'])
print("import type %S %lT\n", s, t);
@@ -333,7 +335,7 @@ importtype(int export, Node *ss, Type *t)
void
importmethod(Sym *s, Type *t)
{
- dowidth(t);
+ checkwidth(t);
addmethod(newname(s), t, 0);
}