summaryrefslogtreecommitdiff
path: root/types.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2019-11-05 14:21:41 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2019-11-05 14:21:41 -0500
commit08a0853923ae5b536b9b853a35ce704ab98c6618 (patch)
tree2cde50b96edc1df03fc48f27571211fe2bce12d5 /types.c
parent16db3a715f4af41c9c66952d459ffed723e186fc (diff)
fixed problems with each loops
Diffstat (limited to 'types.c')
-rw-r--r--types.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/types.c b/types.c
index 7b8e9fb..02c32bc 100644
--- a/types.c
+++ b/types.c
@@ -766,7 +766,8 @@ static bool types_expr(Typer *tr, Expression *e) {
info_print(ea->range.step->where, "Note that the step of an each loop must be a compile-time constant.");
return false;
}
- ea->range.stepval = stepval;
+ val_cast(stepval, &ea->range.step->type, stepval, &ea->type);
+ ea->range.stepval = stepval;
}
if (!each_enter(e, SCOPE_FLAG_CHECK_REDECL)) return false;
if (!types_block(tr, &ea->body)) return false;