mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
More accurate error message
This commit is contained in:
+3
-3
@@ -2509,10 +2509,10 @@ void check_shift(CheckerContext *c, Operand *x, Operand *y, Ast *node, Type *typ
|
|||||||
if (is_type_integer(type_hint)) {
|
if (is_type_integer(type_hint)) {
|
||||||
x->type = type_hint;
|
x->type = type_hint;
|
||||||
} else {
|
} else {
|
||||||
gbString expr_str = expr_to_string(node);
|
gbString x_str = expr_to_string(x->expr);
|
||||||
gbString to_type = type_to_string(type_hint);
|
gbString to_type = type_to_string(type_hint);
|
||||||
error(node, "Cannot convert untyped expression '%s' to '%s'", expr_str, to_type);
|
error(node, "Conversion of shifted operand '%s' to '%s' is not allowed", x_str, to_type);
|
||||||
gb_string_free(expr_str);
|
gb_string_free(x_str);
|
||||||
gb_string_free(to_type);
|
gb_string_free(to_type);
|
||||||
x->mode = Addressing_Invalid;
|
x->mode = Addressing_Invalid;
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user