diff options
| author | gingerBill <bill@gingerbill.org> | 2024-11-04 12:51:54 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2024-11-04 12:51:54 +0000 |
| commit | a0b35f67f83c834f1212aee16bf6fd9103892d90 (patch) | |
| tree | 111f53d9418eb91d54f21c7c1b7787f4ef222548 | |
| parent | bbf76fa43eda31ea993eb4a4cba0d79418f80849 (diff) | |
Fix previous commit for arrays
| -rw-r--r-- | src/check_expr.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 30ca0af23..651d2dc88 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -5397,17 +5397,16 @@ gb_internal Entity *check_selector(CheckerContext *c, Operand *operand, Ast *nod } else { if (is_type_dynamic_array(t)) { init_mem_allocator(c->checker); - } else { - sel = lookup_field(operand->type, field_name, operand->mode == Addressing_Type); - entity = sel.entity; + } + sel = lookup_field(operand->type, field_name, operand->mode == Addressing_Type); + entity = sel.entity; - // NOTE(bill): Add type info needed for fields like 'names' - if (entity != nullptr && (entity->flags&EntityFlag_TypeField)) { - add_type_info_type(c, operand->type); - } - if (is_type_enum(operand->type)) { - add_type_info_type(c, operand->type); - } + // NOTE(bill): Add type info needed for fields like 'names' + if (entity != nullptr && (entity->flags&EntityFlag_TypeField)) { + add_type_info_type(c, operand->type); + } + if (is_type_enum(operand->type)) { + add_type_info_type(c, operand->type); } } } |