Fix double declarations with enum bug
This commit is contained in:
1 parent
a5c1e83ce4
commit
6996df4104
2 files changed
+4
-4
No files matched your search
@@ -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