Improve errors about conversions of constant integers

This commit is contained in:
gingerBill
2023-02-22 11:30:08 +00:00
parent b9f7b2fdfa
commit f5d507a9b9
3 changed files with 82 additions and 15 deletions

View File

@@ -578,7 +578,7 @@ gb_internal void check_const_decl(CheckerContext *ctx, Entity *e, Ast *type_expr
if (operand.mode == Addressing_Invalid ||
base_type(operand.type) == t_invalid) {
gbString str = expr_to_string(init);
error(e->token, "Invalid declaration type '%s'", str);
error(init, "Invalid declaration value '%s'", str);
gb_string_free(str);
}