gingerBill před 5 měsíci
rodič
revize
d9f990d42e
1 změnil soubory, kde provedl 4 přidání a 0 odebrání
  1. 4 0
      src/check_decl.cpp

+ 4 - 0
src/check_decl.cpp

@@ -628,6 +628,10 @@ gb_internal void check_const_decl(CheckerContext *ctx, Entity *e, Ast *type_expr
 				Operand x = {};
 				x.type = entity->type;
 				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)) {
 					gbString expr_str = expr_to_string(init);
 					gbString op_type_str = type_to_string(entity->type);