mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-31 20:00:09 +00:00
Fix #4975
This commit is contained in:
@@ -628,6 +628,10 @@ gb_internal void check_const_decl(CheckerContext *ctx, Entity *e, Ast *type_expr
|
|||||||
Operand x = {};
|
Operand x = {};
|
||||||
x.type = entity->type;
|
x.type = entity->type;
|
||||||
x.mode = Addressing_Variable;
|
x.mode = Addressing_Variable;
|
||||||
|
if (entity->kind == Entity_Constant) {
|
||||||
|
x.mode = Addressing_Constant;
|
||||||
|
x.value = entity->Constant.value;
|
||||||
|
}
|
||||||
if (!check_is_assignable_to(ctx, &x, e->type)) {
|
if (!check_is_assignable_to(ctx, &x, e->type)) {
|
||||||
gbString expr_str = expr_to_string(init);
|
gbString expr_str = expr_to_string(init);
|
||||||
gbString op_type_str = type_to_string(entity->type);
|
gbString op_type_str = type_to_string(entity->type);
|
||||||
|
|||||||
Reference in New Issue
Block a user