mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-29 19:00:06 +00:00
Merge pull request #4608 from zen3ger/assignment-of-non-specialized-parapoly
Fix crash on assignment of parapoly proc to variable
This commit is contained in:
+6
-4
@@ -94,12 +94,14 @@ gb_internal Type *check_init_variable(CheckerContext *ctx, Entity *e, Operand *o
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
if (e2->state.load() != EntityState_Resolved) {
|
if (e2->state.load() != EntityState_Resolved) {
|
||||||
gbString str = type_to_string(t);
|
e->type = t;
|
||||||
defer (gb_string_free(str));
|
|
||||||
error(e->token, "Invalid use of a polymorphic type '%s' in %.*s", str, LIT(context_name));
|
|
||||||
e->type = t_invalid;
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
gbString str = type_to_string(t);
|
||||||
|
defer (gb_string_free(str));
|
||||||
|
error(operand->expr, "Invalid use of a non-specialized polymorphic type '%s' in %.*s", str, LIT(context_name));
|
||||||
|
e->type = t_invalid;
|
||||||
|
return nullptr;
|
||||||
} else if (is_type_empty_union(t)) {
|
} else if (is_type_empty_union(t)) {
|
||||||
gbString str = type_to_string(t);
|
gbString str = type_to_string(t);
|
||||||
defer (gb_string_free(str));
|
defer (gb_string_free(str));
|
||||||
|
|||||||
Reference in New Issue
Block a user