mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 23:58:50 +00:00
Fix checking _ constant declarations with a procedure
This commit is contained in:
+13
-1
@@ -1845,7 +1845,19 @@ void check_stmt_internal(CheckerContext *ctx, Ast *node, u32 flags) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// constant value declarations
|
// constant value declaration
|
||||||
|
// NOTE(bill): Check `_` declarations
|
||||||
|
for_array(i, vd->names) {
|
||||||
|
Ast *name = vd->names[i];
|
||||||
|
if (is_blank_ident(name)) {
|
||||||
|
Entity *e = name->Ident.entity;
|
||||||
|
DeclInfo *d = decl_info_of_entity(e);
|
||||||
|
if (d != nullptr) {
|
||||||
|
check_entity_decl(ctx, e, d, nullptr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
case_end;
|
case_end;
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -962,9 +962,9 @@ void add_type_and_value(CheckerInfo *i, Ast *expr, AddressingMode mode, Type *ty
|
|||||||
void add_entity_definition(CheckerInfo *i, Ast *identifier, Entity *entity) {
|
void add_entity_definition(CheckerInfo *i, Ast *identifier, Entity *entity) {
|
||||||
GB_ASSERT(identifier != nullptr);
|
GB_ASSERT(identifier != nullptr);
|
||||||
GB_ASSERT(identifier->kind == Ast_Ident);
|
GB_ASSERT(identifier->kind == Ast_Ident);
|
||||||
if (is_blank_ident(identifier)) {
|
// if (is_blank_ident(identifier)) {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
if (identifier->Ident.entity != nullptr) {
|
if (identifier->Ident.entity != nullptr) {
|
||||||
// NOTE(bill): Identifier has already been handled
|
// NOTE(bill): Identifier has already been handled
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user