mirror of
https://github.com/odin-lang/Odin.git
synced 2026-02-16 08:04:07 +00:00
Fix #4390 by assigning invalid entity type
This commit is contained in:
@@ -88,11 +88,12 @@ gb_internal Type *check_init_variable(CheckerContext *ctx, Entity *e, Operand *o
|
||||
e->type = t_invalid;
|
||||
return nullptr;
|
||||
} else if (is_type_polymorphic(t)) {
|
||||
Entity *e = entity_of_node(operand->expr);
|
||||
if (e == nullptr) {
|
||||
Entity *e2 = entity_of_node(operand->expr);
|
||||
if (e2 == nullptr) {
|
||||
e->type = t_invalid;
|
||||
return nullptr;
|
||||
}
|
||||
if (e->state.load() != EntityState_Resolved) {
|
||||
if (e2->state.load() != EntityState_Resolved) {
|
||||
gbString str = type_to_string(t);
|
||||
defer (gb_string_free(str));
|
||||
error(e->token, "Invalid use of a polymorphic type '%s' in %.*s", str, LIT(context_name));
|
||||
|
||||
Reference in New Issue
Block a user