diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2019-11-05 14:21:41 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2019-11-05 14:21:41 -0500 |
commit | 08a0853923ae5b536b9b853a35ce704ab98c6618 (patch) | |
tree | 2cde50b96edc1df03fc48f27571211fe2bce12d5 /types.c | |
parent | 16db3a715f4af41c9c66952d459ffed723e186fc (diff) |
fixed problems with each loops
Diffstat (limited to 'types.c')
-rw-r--r-- | types.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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; |