diff options
| author | Airtz <72342006+Airtz@users.noreply.github.com> | 2025-06-20 04:49:39 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-20 04:49:39 +0200 |
| commit | 7c5b5618e8fb27589d6ae14b217dd0288a6621e2 (patch) | |
| tree | 9a1a60627a131127ada59ecc5cbc84b777bda2fd | |
| parent | c7c5258c587b38508cd855ff2488a842503233eb (diff) | |
`check_is_expressible` instead of `convert_to_typed` when there is no `type_hint`
| -rw-r--r-- | src/check_expr.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 6ee6de146..7cf4ef83a 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -3160,12 +3160,11 @@ gb_internal void check_shift(CheckerContext *c, Operand *x, Operand *y, Ast *nod if (x->mode == Addressing_Constant) { if (x_is_untyped) { - Type *def_type = default_type(t_untyped_integer); if (type_hint) { if (is_type_integer(type_hint)) { convert_to_typed(c, x, type_hint); } else if (is_type_any(type_hint)) { - convert_to_typed(c, x, def_type); + convert_to_typed(c, x, default_type(t_untyped_integer)); } else { gbString x_str = expr_to_string(x->expr); gbString type_str = type_to_string(type_hint); @@ -3176,7 +3175,7 @@ gb_internal void check_shift(CheckerContext *c, Operand *x, Operand *y, Ast *nod return; } } else { - convert_to_typed(c, x, def_type); + check_is_expressible(c, x, default_type(t_untyped_integer)); } if (x->mode == Addressing_Invalid) { return; |