mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-04 22:58:46 +00:00
Add enum type info and fix enum casting
This commit is contained in:
+2
-3
@@ -848,7 +848,7 @@ void check_stmt_internal(Checker *c, AstNode *node, u32 flags) {
|
||||
tt = make_type_pointer(c->allocator, case_type);
|
||||
add_type_info_type(c, tt);
|
||||
}
|
||||
Entity *tag_var = make_entity_variable(c->allocator, c->context.scope, ms->var->Ident, tt, false);
|
||||
Entity *tag_var = make_entity_variable(c->allocator, c->context.scope, ms->var->Ident, tt);
|
||||
tag_var->flags |= EntityFlag_Used;
|
||||
add_entity(c, c->context.scope, ms->var, tag_var);
|
||||
add_entity_use(c, ms->var, tag_var);
|
||||
@@ -1106,7 +1106,6 @@ void check_stmt_internal(Checker *c, AstNode *node, u32 flags) {
|
||||
case_end;
|
||||
case_ast_node(vs, ValueSpec, spec);
|
||||
switch (vs->keyword) {
|
||||
case Token_let:
|
||||
case Token_var: {
|
||||
isize entity_count = vs->names.count;
|
||||
isize entity_index = 0;
|
||||
@@ -1124,7 +1123,7 @@ void check_stmt_internal(Checker *c, AstNode *node, u32 flags) {
|
||||
found = current_scope_lookup_entity(c->context.scope, str);
|
||||
}
|
||||
if (found == NULL) {
|
||||
entity = make_entity_variable(c->allocator, c->context.scope, token, NULL, vs->keyword == Token_let);
|
||||
entity = make_entity_variable(c->allocator, c->context.scope, token, NULL);
|
||||
add_entity_definition(&c->info, name, entity);
|
||||
} else {
|
||||
TokenPos pos = found->token.pos;
|
||||
|
||||
Reference in New Issue
Block a user