mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-02 12:48:14 +00:00
add: type_integer_to_* error messages
This commit is contained in:
@@ -5904,8 +5904,7 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As
|
|||||||
|
|
||||||
if ((bt->Basic.flags & BasicFlag_Untyped) != 0) {
|
if ((bt->Basic.flags & BasicFlag_Untyped) != 0) {
|
||||||
gbString t = type_to_string(operand->type);
|
gbString t = type_to_string(operand->type);
|
||||||
// NOTE: What should this error message be?
|
error(operand->expr, "Expected a non-untyped integer type for '%.*s', got %s", LIT(builtin_name), t);
|
||||||
error(operand->expr, "Expected a typed integer for '%.*s', got %s", LIT(builtin_name), t);
|
|
||||||
gb_string_free(t);
|
gb_string_free(t);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -5942,16 +5941,14 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As
|
|||||||
|
|
||||||
if ((bt->Basic.flags & BasicFlag_Untyped) != 0) {
|
if ((bt->Basic.flags & BasicFlag_Untyped) != 0) {
|
||||||
gbString t = type_to_string(operand->type);
|
gbString t = type_to_string(operand->type);
|
||||||
// NOTE: What should this error message be?
|
error(operand->expr, "Expected a non-untyped integer type for '%.*s', got %s", LIT(builtin_name), t);
|
||||||
error(operand->expr, "Expected a typed integer for '%.*s', got %s", LIT(builtin_name), t);
|
|
||||||
gb_string_free(t);
|
gb_string_free(t);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bt->Basic.kind == Basic_uintptr) {
|
if (bt->Basic.kind == Basic_uintptr) {
|
||||||
gbString t = type_to_string(operand->type);
|
gbString t = type_to_string(operand->type);
|
||||||
// TODO: Robust error message for uintptr does not have a signed integer representation
|
error(operand->expr, "Type %s does not have a signed integer mapping for '%.*s'", t, LIT(builtin_name));
|
||||||
error(operand->expr, "Expected a signed integer type for '%.*s', got %s", LIT(builtin_name), t);
|
|
||||||
gb_string_free(t);
|
gb_string_free(t);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user