summaryrefslogtreecommitdiff
path: root/parse
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-09-05 22:37:58 -0700
committerOri Bernstein <ori@eigenstate.org>2017-09-05 22:37:58 -0700
commit13a8561e53b259ab1bd6592df857b7a59b7a2a2b (patch)
tree8fb86de77cb29d59ef1e9d39f8ddb00c46a4198b /parse
parent5729c9940095be2916feb43b478559082744ba5c (diff)
downloadmc-13a8561e53b259ab1bd6592df857b7a59b7a2a2b.tar.gz
Fix traits on named types.
Erm.
Diffstat (limited to 'parse')
-rw-r--r--parse/infer.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/parse/infer.c b/parse/infer.c
index 9cd598f..f03c6bc 100644
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -921,6 +921,7 @@ static void
traitsfor(Type *base, Bitset *dst)
{
Traitmap *tm;
+ Bitset *bs;
Type *ty;
size_t i;
@@ -930,7 +931,12 @@ traitsfor(Type *base, Bitset *dst)
while (1) {
if (ty->type == Tyvar)
break;
- bsunion(dst, tm->traits);
+ if (ty->type == Tyname && ty->ngparam == 0)
+ bs = htget(tm->name, ty->name);
+ else
+ bs = tm->traits;
+ if (bs)
+ bsunion(dst, bs);
for (i = 0; i < tm->nfilter; i++) {
if (tymatchrank(tm->filter[i], ty) >= 0)
bsput(dst, tm->filtertr[i]->uid);