summaryrefslogtreecommitdiff
path: root/src/cmd/gc/export.c
diff options
context:
space:
mode:
authorMichael Stapelberg <stapelberg@debian.org>2013-12-03 09:43:15 +0100
committerMichael Stapelberg <stapelberg@debian.org>2013-12-03 09:43:15 +0100
commit64d2a7c8945ba05af859901f5e248f1befdd8621 (patch)
tree013fcb7e9e3296ecdda876012252c36bd6bcb063 /src/cmd/gc/export.c
parentb901efe83e212f0c34c769c079e41373da12d723 (diff)
downloadgolang-64d2a7c8945ba05af859901f5e248f1befdd8621.tar.gz
Imported Upstream version 1.2upstream/1.2
Diffstat (limited to 'src/cmd/gc/export.c')
-rw-r--r--src/cmd/gc/export.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/cmd/gc/export.c b/src/cmd/gc/export.c
index caac330d5..31bcdf8e7 100644
--- a/src/cmd/gc/export.c
+++ b/src/cmd/gc/export.c
@@ -44,7 +44,7 @@ initname(char *s)
return strcmp(s, "init") == 0;
}
-// exportedsym returns whether a symbol will be visible
+// exportedsym reports whether a symbol will be visible
// to files that import our package.
static int
exportedsym(Sym *sym)
@@ -481,9 +481,10 @@ importvar(Sym *s, Type *t)
if(s->def != N && s->def->op == ONAME) {
if(eqtype(t, s->def->type))
return;
- yyerror("inconsistent definition for var %S during import\n\t%T\n\t%T", s, s->def->type, t);
+ yyerror("inconsistent definition for var %S during import\n\t%T (in \"%Z\")\n\t%T (in \"%Z\")", s, s->def->type, s->importdef->path, t, importpkg->path);
}
n = newname(s);
+ s->importdef = importpkg;
n->type = t;
declare(n, PEXTERN);
@@ -509,11 +510,12 @@ importtype(Type *pt, Type *t)
n = pt->nod;
copytype(pt->nod, t);
pt->nod = n; // unzero nod
+ pt->sym->importdef = importpkg;
pt->sym->lastlineno = parserline();
declare(n, PEXTERN);
checkwidth(pt);
} else if(!eqtype(pt->orig, t))
- yyerror("inconsistent definition for type %S during import\n\t%lT\n\t%lT", pt->sym, pt, t);
+ yyerror("inconsistent definition for type %S during import\n\t%lT (in \"%Z\")\n\t%lT (in \"%Z\")", pt->sym, pt, pt->sym->importdef->path, t, importpkg->path);
if(debug['E'])
print("import type %T %lT\n", pt, t);