summaryrefslogtreecommitdiff
path: root/parse/node.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2019-03-03 21:43:58 -0800
committerOri Bernstein <ori@eigenstate.org>2019-03-03 21:43:58 -0800
commitf5e054e36b30b4ef160f063c093be55e10585ed5 (patch)
treef89720f4fcfada1192b5eea3688600e42cbd2d53 /parse/node.c
parent62bd41784b871d00d347787069cc31f4d5e41f4f (diff)
downloadmc-f5e054e36b30b4ef160f063c093be55e10585ed5.tar.gz
Merge envs correctly.
Still a couple of straggling issues, but almost there.
Diffstat (limited to 'parse/node.c')
-rw-r--r--parse/node.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/parse/node.c b/parse/node.c
index 0bc31c0..85f1763 100644
--- a/parse/node.c
+++ b/parse/node.c
@@ -207,15 +207,11 @@ mkfunc(Srcloc loc, Node **args, size_t nargs, Type *ret, Node *body)
f->func.type = mktyfunc(loc, args, nargs, ret);
f->func.env = mkenv();
+ bindtype(f->func.env, f->func.type);
st = body->block.scope;
for (i = 0; i < nargs; i++)
putdcl(st, args[i]);
- bindtype(f->func.env, ret);
- for (i = 0; i < nargs; i++)
- bindtype(f->func.env, decltype(args[i]));
-
-
n = mknode(loc, Nlit);
n->lit.littype = Lfunc;
n->lit.fnval = f;