aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author0xrsp <95966883+0xrsp@users.noreply.github.com>2025-05-15 01:12:06 +0930
committer0xrsp <95966883+0xrsp@users.noreply.github.com>2025-05-15 01:12:06 +0930
commit649cad2f1bc260f46df78cf764cb23f3bb3cd2ec (patch)
treef3f83f6cba537d51fdf5cc044e7ea3520c10db68
parentcb0cab36b9423dcaae3d61a7d3df547936c88137 (diff)
add: type_integer_to_* error messages
-rw-r--r--src/check_builtin.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/check_builtin.cpp b/src/check_builtin.cpp
index 147d4ba3a..f384cb7e1 100644
--- a/src/check_builtin.cpp
+++ b/src/check_builtin.cpp
@@ -5904,8 +5904,7 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As
if ((bt->Basic.flags & BasicFlag_Untyped) != 0) {
gbString t = type_to_string(operand->type);
- // NOTE: What should this error message be?
- error(operand->expr, "Expected a typed integer for '%.*s', got %s", LIT(builtin_name), t);
+ error(operand->expr, "Expected a non-untyped integer type for '%.*s', got %s", LIT(builtin_name), t);
gb_string_free(t);
return false;
}
@@ -5942,16 +5941,14 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As
if ((bt->Basic.flags & BasicFlag_Untyped) != 0) {
gbString t = type_to_string(operand->type);
- // NOTE: What should this error message be?
- error(operand->expr, "Expected a typed integer for '%.*s', got %s", LIT(builtin_name), t);
+ error(operand->expr, "Expected a non-untyped integer type for '%.*s', got %s", LIT(builtin_name), t);
gb_string_free(t);
return false;
}
if (bt->Basic.kind == Basic_uintptr) {
gbString t = type_to_string(operand->type);
- // TODO: Robust error message for uintptr does not have a signed integer representation
- error(operand->expr, "Expected a signed integer type for '%.*s', got %s", LIT(builtin_name), t);
+ error(operand->expr, "Type %s does not have a signed integer mapping for '%.*s'", t, LIT(builtin_name));
gb_string_free(t);
return false;
}