summaryrefslogtreecommitdiff
path: root/parse/infer.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2019-04-12 22:48:43 -0700
committerOri Bernstein <ori@eigenstate.org>2019-04-12 22:48:43 -0700
commit537313ee9a2179cc6e869c6e8c70da4af1f07f28 (patch)
tree6cc091ad8c73b5e71755c6f4977de8d0e1d98fd1 /parse/infer.c
parent6940a02fd47d73ba5dd0ad3a82b1945b639a23dc (diff)
downloadmc-537313ee9a2179cc6e869c6e8c70da4af1f07f28.tar.gz
Rename traits correctly.
Diffstat (limited to 'parse/infer.c')
-rw-r--r--parse/infer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/parse/infer.c b/parse/infer.c
index 75ca5ec..725c4d3 100644
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -554,6 +554,7 @@ tyresolve(Type *t)
bsput(t->trneed, tr->uid);
if (nameeq(t->spec[i]->trait[j], traittab[Tciter]->name))
t->seqaux = t->spec[i]->aux;
+ t->spec[i]->trait[j] = tr->name;
}
}
@@ -2800,7 +2801,7 @@ specialize(void)
assert(tr->nproto == 2);
ty = exprtype(n->iterstmt.seq);
if (ty->type == Typaram)
- continue;
+ goto enditer;
it = itertype(n->iterstmt.seq, mktype(n->loc, Tybool));
d = specializedcl(tr->proto[0], ty, it, &name);
@@ -2812,6 +2813,7 @@ specialize(void)
} else {
die("unknown node for specialization\n");
}
+enditer:
popstab();
}
}
@@ -3027,6 +3029,7 @@ infer(void)
for (i = 0; i < file.nstmts; i++)
typesub(file.stmts[i], 0);
popstab();
+
specialize();
verify();
}