summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--parse/infer.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/parse/infer.c b/parse/infer.c
index 67db28f..6c7a1a2 100644
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -2031,9 +2031,6 @@ tyfix(Node *ctx, Type *orig, int noerr)
t->fixed = 1;
if (t->type == Tyarray) {
typesub(t->asize, noerr);
- t->asize = fold(t->asize, 1);
- if (t->asize && exprop(t->asize) != Olit)
- fatal(t->asize, "nonconstant array size near %s\n", ctxstr(t->asize));
} else if (t->type == Tystruct) {
inaggr++;
for (i = 0; i < t->nmemb; i++)
@@ -2593,6 +2590,7 @@ applytraits(Node *f)
void
verify(Node *f)
{
+ Type *t;
Node *n;
size_t i;
@@ -2607,6 +2605,14 @@ verify(Node *f)
namestr(n->impl.traitname), tystr(n->impl.type));
}
}
+ for (i = 0; i < ntypes; i++) {
+ t = types[i];
+ if (t->type != Tyarray)
+ continue;
+ t->asize = fold(t->asize, 1);
+ if (t->asize && exprop(t->asize) != Olit)
+ fatal(t->asize, "nonconstant array size near %s\n", ctxstr(t->asize));
+ }
}
void