summaryrefslogtreecommitdiff
path: root/parse
diff options
context:
space:
mode:
authorOri Bernstein <ori@markovcorp.com>2017-08-23 10:56:45 -0700
committerOri Bernstein <ori@markovcorp.com>2017-08-23 10:56:45 -0700
commitf363110a62803e055334516ba0e1899e62be65ac (patch)
tree090f7c081dab8d47f58231c8cb8713c4ff997dce /parse
parent9f4568a0cd45791102980cecb76aaba3ff5b254e (diff)
downloadmc-f363110a62803e055334516ba0e1899e62be65ac.tar.gz
Resolve types in match rank.
Diffstat (limited to 'parse')
-rw-r--r--parse/infer.c4
-rw-r--r--parse/type.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/parse/infer.c b/parse/infer.c
index 5d9ecfc..b8386cc 100644
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -2723,8 +2723,8 @@ addtraittab(Traitmap *m, Trait *tr, Type *ty)
if (istyprimitive(ty)) {
bsput(mm->traits, tr->uid);
} else {
- lappend(&mm->filter, &m->nfilter, ty);
- lappend(&mm->filtertr, &m->nfiltertr, tr);
+ lappend(&mm->filter, &mm->nfilter, ty);
+ lappend(&mm->filtertr, &mm->nfiltertr, tr);
}
}
}
diff --git a/parse/type.c b/parse/type.c
index 6d26670..92d611d 100644
--- a/parse/type.c
+++ b/parse/type.c
@@ -859,6 +859,8 @@ tymatchrank(Type *pat, Type *to)
size_t i;
Ucon *puc, *tuc;
+ pat = tysearch(pat);
+ to = tysearch(to);
if (pat->type == Typaram)
return 0;
else if (pat->type != to->type)