diff options
| author | gingerBill <bill@gingerbill.org> | 2024-08-04 12:08:52 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2024-08-04 12:08:52 +0100 |
| commit | 5187bb68bb46a508c90c83861973c57b8e89d005 (patch) | |
| tree | efd0ce714d5756f4df55683e4e43e8bcd37a96a9 /src/check_expr.cpp | |
| parent | 97c499dbb40deeef3778c9a20aa2b38d96aa46f1 (diff) | |
Hack: Convert `0` to `nil`
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 9efd16af4..06784a7f3 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -4470,7 +4470,10 @@ gb_internal void convert_to_typed(CheckerContext *c, Operand *operand, Type *tar if (is_exact_value_zero(operand->value) && (operand->value.kind == ExactValue_Integer || operand->value.kind == ExactValue_Float)) { - update_untyped_expr_value(c, operand->expr, empty_exact_value); + operand->mode = Addressing_Value; + target_type = t_untyped_nil; + operand->value = empty_exact_value; + update_untyped_expr_value(c, operand->expr, operand->value); break; } } |