mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-07 16:18:52 +00:00
Fix double declarations with enum bug
This commit is contained in:
@@ -6,5 +6,3 @@ main :: proc() {
|
|||||||
v[0] = 123
|
v[0] = 123
|
||||||
fmt.println("Hellope!", v, v[0], a)
|
fmt.println("Hellope!", v, v[0], a)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -753,10 +753,12 @@ void check_enum_type(Checker *c, Type *enum_type, Type *named_type, AstNode *nod
|
|||||||
add_entity_use(c, f->field, e);
|
add_entity_use(c, f->field, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
gb_sort_array(fields, et->fields.count, cmp_enum_order);
|
GB_ASSERT(field_index <= et->fields.count);
|
||||||
|
|
||||||
|
gb_sort_array(fields, field_index, cmp_enum_order);
|
||||||
|
|
||||||
enum_type->Record.other_fields = fields;
|
enum_type->Record.other_fields = fields;
|
||||||
enum_type->Record.other_field_count = et->fields.count;
|
enum_type->Record.other_field_count = field_index;
|
||||||
|
|
||||||
enum_type->Record.enum_count = make_entity_constant(c->allocator, NULL,
|
enum_type->Record.enum_count = make_entity_constant(c->allocator, NULL,
|
||||||
make_token_ident(make_string("count")), t_int, make_exact_value_integer(enum_type->Record.other_field_count));
|
make_token_ident(make_string("count")), t_int, make_exact_value_integer(enum_type->Record.other_field_count));
|
||||||
|
|||||||
Reference in New Issue
Block a user