summaryrefslogtreecommitdiff
path: root/parse/infer.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2018-01-01 21:09:50 -0800
committerOri Bernstein <ori@eigenstate.org>2018-01-11 22:16:11 -0800
commit90e26e0f687da28530b3b967df0cedf20407c071 (patch)
tree09c85ff396a5f235dbcbd5db2df911b5217bb472 /parse/infer.c
parent94448201527e0c47c2924219bf1a8d0c0c2406b7 (diff)
downloadmc-90e26e0f687da28530b3b967df0cedf20407c071.tar.gz
Move to new trait syntax.
Diffstat (limited to 'parse/infer.c')
-rw-r--r--parse/infer.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/parse/infer.c b/parse/infer.c
index 55628a5..69419d3 100644
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -66,7 +66,6 @@ static Node **specializations;
static size_t nspecializations;
static Stab **specializationscope;
static size_t nspecializationscope;
-static Htab *seqbase;
static Traitmap *traitmap;
static void
@@ -482,7 +481,7 @@ tyfreshen(Tysubst *subst, Type *orig)
static void
tyresolve(Type *t)
{
- size_t i;
+ size_t i, j;
Trait *tr;
if (t->resolved)
@@ -526,13 +525,15 @@ tyresolve(Type *t)
break;
}
- for (i = 0; i < t->ntraits; i++) {
- tr = gettrait(curstab(), t->traits[i]);
- if (!tr)
- lfatal(t->loc, "trait %s does not exist", ctxstr(t->traits[i]));
- if (!t->trneed)
- t->trneed = mkbs();
- bsput(t->trneed, tr->uid);
+ for (i = 0; i < t->nspec; i++) {
+ for (j = 0; j < t->spec[i]->ntraits; j++) {
+ tr = gettrait(curstab(), t->spec[i]->traits[j]);
+ if (!tr)
+ lfatal(t->loc, "trait %s does not exist", ctxstr(t->spec[i]->traits[j]));
+ if (!t->trneed)
+ t->trneed = mkbs();
+ bsput(t->trneed, tr->uid);
+ }
}
for (i = 0; i < t->nsub; i++) {
@@ -2898,7 +2899,6 @@ void
infer(void)
{
delayed = mkht(tyhash, tyeq);
- seqbase = mkht(tyhash, tyeq);
loaduses();
initimpl();