summaryrefslogtreecommitdiff
path: root/parse/specialize.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-02-06 22:38:29 -0800
committerOri Bernstein <ori@eigenstate.org>2016-02-07 01:16:49 -0800
commit03857943018a82e1101cecbb026b5e11f4061dc5 (patch)
treef3bec664245228aa862cf28f35d0a6aeca899d14 /parse/specialize.c
parent061c7f286ebf2ee6e0afb0a0fb2b90397b848e23 (diff)
downloadmc-03857943018a82e1101cecbb026b5e11f4061dc5.tar.gz
Generic iterators now seem to work.
Diffstat (limited to 'parse/specialize.c')
-rw-r--r--parse/specialize.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/parse/specialize.c b/parse/specialize.c
index 33f48a4..72f922f 100644
--- a/parse/specialize.c
+++ b/parse/specialize.c
@@ -116,6 +116,7 @@ Type *tyspecialize(Type *orig, Tysubst *tsmap, Htab *delayed, Htab *trbase)
ret->issynth = 1;
ret->arg = arg;
ret->narg = narg;
+ ret->traits = bsdup(t->traits);
tytab[var->tid] = ret;
break;
case Tyname:
@@ -543,6 +544,8 @@ Node *bestimpl(Node *n, Type *to)
int score;
int best;
+ if (hthas(n->decl.impls, to))
+ return htget(n->decl.impls, to);
ambig = NULL;
nambig = 0;
best = -1;