summaryrefslogtreecommitdiff
path: root/parse/stab.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-10-29 18:17:29 -0700
committerOri Bernstein <ori@eigenstate.org>2017-10-29 18:17:29 -0700
commitd359a98ab9cfc42de66ad35333bd6d6c0571b7ca (patch)
tree863b83c7653535a5e0c141733a0553381052921c /parse/stab.c
parent4adc2f773870b45442ed27e5e794ade92e4fe2f0 (diff)
downloadmc-d359a98ab9cfc42de66ad35333bd6d6c0571b7ca.tar.gz
Fix traits when exported cross-namespaces.
Diffstat (limited to 'parse/stab.c')
-rw-r--r--parse/stab.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/parse/stab.c b/parse/stab.c
index 023e9f7..49fc776 100644
--- a/parse/stab.c
+++ b/parse/stab.c
@@ -581,6 +581,9 @@ putimpl(Stab *st, Node *n)
fatal(n, "trait %s already implemented over %s at %s:%d",
namestr(n->impl.traitname), tystr(n->impl.type),
fname(n->loc), lnum(n->loc));
+ /* if this is not a duplicate, record it for later export */
+ if (!impl)
+ lappend(&file->file.impl, &file->file.nimpl, n);
/*
The impl is not defined in this file, so setting the
trait name would be a bug here.