summaryrefslogtreecommitdiff
path: root/parse/stab.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-10-21 19:49:23 -0700
committerOri Bernstein <ori@eigenstate.org>2017-10-21 19:56:13 -0700
commitd4862853ca810b97d1adc2944f32975fd4a5018f (patch)
tree11ece02b233083f4cd4d7da8ae9f773e74229980 /parse/stab.c
parentb7cd6588a862680434445e53f27125e43d76a4af (diff)
downloadmc-d4862853ca810b97d1adc2944f32975fd4a5018f.tar.gz
Don't bungle trait merging and exporting.
Diffstat (limited to 'parse/stab.c')
-rw-r--r--parse/stab.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/parse/stab.c b/parse/stab.c
index 7c031f9..c24b4a4 100644
--- a/parse/stab.c
+++ b/parse/stab.c
@@ -523,9 +523,12 @@ puttrait(Stab *st, Node *n, Trait *c)
st = findstab(st, n);
t = gettrait(st, n);
- if (t && !mergetrait(t, c))
+ if (t) {
+ if (mergetrait(t, c))
+ return;
fatal(n, "trait %s already defined on %s:%d",
namestr(n), fname(t->loc), lnum(t->loc));
+ }
ty = gettype(st, n);
if (ty)
fatal(n, "trait %s defined as a type on %s:%d",