diff options
author | Russ Cox <rsc@golang.org> | 2009-10-07 14:55:12 -0700 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2009-10-07 14:55:12 -0700 |
commit | 8d2c6f61d1047d54d9c550cbfaa0573b105bc51d (patch) | |
tree | 0bc92db04f9ce77a95481c15bd0f644999245d17 /src/cmd/gc/subr.c | |
parent | c347fdc13f125e304e5fa1ab24bed22362ebd4c5 (diff) | |
download | golang-8d2c6f61d1047d54d9c550cbfaa0573b105bc51d.tar.gz |
better handling of mistaken top-level variable
references during the parsing of :=. the base
problem is that when reading
a,b,c,d
the parser makes those refer to existing variables,
which might create a few stub top-level ones
for undefined names, but then if a := is the next
token, we need to undo those stubs.
this was causing problems in multifile packages
in which one file used a := variable named rpc
and the other imported a package named rpc.
R=ken
OCL=35446
CL=35446
Diffstat (limited to 'src/cmd/gc/subr.c')
-rw-r--r-- | src/cmd/gc/subr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/gc/subr.c b/src/cmd/gc/subr.c index 97fdc4f19..007344e93 100644 --- a/src/cmd/gc/subr.c +++ b/src/cmd/gc/subr.c @@ -269,7 +269,7 @@ importdot(Sym *opkg, Node *pack) } if(n == 0) { // can't possibly be used - there were no symbols - print("%L: imported and not used: %s\n", pack->pline, pack->sym->name); + print("%L: imported and not used: %s\n", pack->lineno, pack->sym->name); nerrors++; } } |