summaryrefslogtreecommitdiff
path: root/types.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2019-11-27 18:36:36 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2019-11-27 18:36:36 -0500
commite2bac7ba27e82cd3c249b577f363fa8c3fca0092 (patch)
tree5bfa2890a0375df09681525802cc232fa644e3eb /types.c
parent7c232ad8c766eef3b498900803bbbe01e865de8c (diff)
fixed problem where functions could have tuple parameters
Diffstat (limited to 'types.c')
-rw-r--r--types.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/types.c b/types.c
index 2bbe4df..d4d0414 100644
--- a/types.c
+++ b/types.c
@@ -1145,7 +1145,7 @@ static bool types_expr(Typer *tr, Expression *e) {
new_args[i].flags = copy.flags;
new_args[i].type = copy.type;
- copy_val(&cop, &new_args[i].val,
+ copy_val(tr->allocr, &new_args[i].val,
&default_val, &new_args[i].type);
} else {
/* it's already been evaluated */
@@ -1224,10 +1224,10 @@ static bool types_expr(Typer *tr, Expression *e) {
new_args[i].kind = EXPR_VAL;
new_args[i].flags = EXPR_FOUND_TYPE;
- copy_val(&cop, &new_args[i].val, arg_val, type);
+ copy_val(tr->allocr, &new_args[i].val, arg_val, type);
new_args[i].val = *arg_val;
new_args[i].type = *type;
- copy_val(&cop, &param_decl->val, arg_val, type);
+ copy_val(tr->allocr, &param_decl->val, arg_val, type);
param_decl->flags |= DECL_FOUND_VAL;
if (fn_type->constness[i] == CONSTNESS_SEMI) {
@@ -1766,8 +1766,7 @@ static bool types_decl(Typer *tr, Declaration *d) {
success = false;
goto ret;
}
- Copier cop = {.block = tr->block, .allocr = tr->allocr};
- copy_val(&cop, &d->val, &val, &d->type);
+ copy_val(tr->allocr, &d->val, &val, &d->type);
d->flags |= DECL_FOUND_VAL;
}
}