diff options
| author | Jasper Yujin Geer <jasper.geer@gmail.com> | 2022-08-10 18:07:49 -0700 |
|---|---|---|
| committer | Jasper Yujin Geer <jasper.geer@gmail.com> | 2022-08-10 18:07:49 -0700 |
| commit | 5b621d5be18523939ded57cba24b3b3d19b774bd (patch) | |
| tree | da64237de8da9e303470a8b6867d39361335c80e /src/check_expr.cpp | |
| parent | 7aee762f3afe4ff40f7365082d45a32f52328e74 (diff) | |
More accurate error message
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 4dab26572..83bec20ae 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -2509,10 +2509,10 @@ void check_shift(CheckerContext *c, Operand *x, Operand *y, Ast *node, Type *typ if (is_type_integer(type_hint)) { x->type = type_hint; } else { - gbString expr_str = expr_to_string(node); + gbString x_str = expr_to_string(x->expr); gbString to_type = type_to_string(type_hint); - error(node, "Cannot convert untyped expression '%s' to '%s'", expr_str, to_type); - gb_string_free(expr_str); + error(node, "Conversion of shifted operand '%s' to '%s' is not allowed", x_str, to_type); + gb_string_free(x_str); gb_string_free(to_type); x->mode = Addressing_Invalid; return; |