mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-19 04:12:22 -07:00
Fix array lengths with enum value counts.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user