mirror of
https://github.com/odin-lang/Odin.git
synced 2026-05-25 13:18:14 +00:00
Merge pull request #6599 from 3rd-Party-Guy/issue/6594-self-ref-global-init
Fixes #6594
This commit is contained in:
@@ -1919,6 +1919,16 @@ gb_internal Entity *check_ident(CheckerContext *c, Operand *o, Ast *n, Type *nam
|
||||
if (e->state == EntityState_Unresolved) {
|
||||
check_entity_decl(c, e, nullptr, named_type);
|
||||
}
|
||||
switch (e->kind) {
|
||||
case Entity_Constant:
|
||||
case Entity_Variable:
|
||||
case Entity_TypeName:
|
||||
if (check_cycle(c, e, true)) {
|
||||
o->type = t_invalid;
|
||||
return e;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (e->type == nullptr) {
|
||||
// TODO(bill): Which is correct? return or compiler_error?
|
||||
// compiler_error("How did this happen? type: %s; identifier: %.*s\n", type_to_string(e->type), LIT(name));
|
||||
|
||||
Reference in New Issue
Block a user