From 6075f33768b3a160fa1a06e54253f9cd565241ec Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Tue, 8 Oct 2019 14:32:22 -0400 Subject: eval fn calling (eval is done./runv) --- types.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'types.c') diff --git a/types.c b/types.c index b23fbcd..98a47dd 100644 --- a/types.c +++ b/types.c @@ -423,16 +423,10 @@ static bool types_expr(Typer *tr, Expression *e) { tr->ret_type = t->fn.types[0]; } tr->can_ret = true; - arr_foreach(f->params, Declaration, decl) - add_ident_decls(&f->body, decl); - arr_foreach(f->ret_decls, Declaration, decl) - add_ident_decls(&f->body, decl); + fn_enter(f); bool block_success = true; block_success = types_block(tr, &e->fn.body); - arr_foreach(f->params, Declaration, decl) - remove_ident_decls(&f->body, decl); - arr_foreach(f->ret_decls, Declaration, decl) - remove_ident_decls(&f->body, decl); + fn_exit(f); if (!block_success) { success = false; goto fn_ret; -- cgit v1.2.3