Fix array lengths with enum value counts.

This commit is contained in:
gingerBill
2019-12-27 13:55:18 +00:00
parent 10f0961184
commit 880c7f01a8
6 changed files with 133 additions and 17 deletions
+3
View File
@@ -161,6 +161,8 @@ void check_init_constant(CheckerContext *ctx, Entity *e, Operand *operand) {
}
return;
}
#if 1
if (!is_type_constant_type(operand->type)) {
gbString type_str = type_to_string(operand->type);
error(operand->expr, "Invalid constant type: '%s'", type_str);
@@ -170,6 +172,7 @@ void check_init_constant(CheckerContext *ctx, Entity *e, Operand *operand) {
}
return;
}
#endif
if (e->type == nullptr) { // NOTE(bill): type inference
e->type = operand->type;