summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/eval.c b/eval.c
index 1c682ff..6ff8d8a 100644
--- a/eval.c
+++ b/eval.c
@@ -1505,6 +1505,8 @@ static bool eval_expr(Evaluator *ev, Expression *e, Value *v) {
if (!eval_expr(ev, &d->expr, &val))
return false;
+ if (!add_ident_decls(&fn->body, d, 0))
+ return false;
arr_foreach(d->idents, Identifier, i) {
Type *type = d->type.kind == TYPE_TUPLE ? &d->type.tuple[idx] : &d->type;
IdentDecl *id = ident_decl(*i);
@@ -1517,8 +1519,6 @@ static bool eval_expr(Evaluator *ev, Expression *e, Value *v) {
}
++idx;
}
- if (!add_ident_decls(&fn->body, d, 0))
- return false;
}
if (!eval_block(ev, &fn->body, &e->type, v)) {
fn_exit(fn);