summaryrefslogtreecommitdiff
path: root/parse
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-10-19 19:59:36 -0700
committerOri Bernstein <ori@eigenstate.org>2017-10-19 20:00:19 -0700
commitb7cd6588a862680434445e53f27125e43d76a4af (patch)
tree6d5d188046a2242cc19c7c0acc60c8e5beec4660 /parse
parentfc4fca0fa6c64a0fbe6fbb5c8faf1e5640b784ea (diff)
downloadmc-b7cd6588a862680434445e53f27125e43d76a4af.tar.gz
Push the env before specializing the proto type.
Diffstat (limited to 'parse')
-rw-r--r--parse/infer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/parse/infer.c b/parse/infer.c
index d204e6d..34c4155 100644
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -1965,6 +1965,7 @@ specializeimpl(Node *n)
namestr(t->name), ctxstr(n));
/* infer and unify types */
+ pushenv(proto->decl.env);
verifytraits(n, t->param, n->impl.type);
subst = mksubst();
substput(subst, t->param, n->impl.type);
@@ -1972,6 +1973,7 @@ specializeimpl(Node *n)
substput(subst, t->aux[j], n->impl.aux[j]);
ty = tyspecialize(type(proto), subst, delayed, NULL);
substfree(subst);
+ popenv(proto->decl.env);
generic = hasparams(ty);
if (generic)