diff options
Diffstat (limited to 'types.c')
-rw-r--r-- | types.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1111,7 +1111,7 @@ static bool types_decl(Typer *tr, Declaration *d) { d->type = d->expr.type; d->type.flags &= (uint16_t)~(uint16_t)TYPE_FLAG_FLEXIBLE; /* x := 5; => x is not flexible */ } - if (d->flags & DECL_FLAG_CONST) { + if ((d->flags & DECL_FLAG_CONST) || tr->block == NULL) { if (!(d->flags & DECL_FLAG_FOUND_VAL)) { if (!eval_expr(tr->evalr, &d->expr, &d->val)) return false; |