aboutsummaryrefslogtreecommitdiff
path: root/src/check_expr.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-05-22 12:42:02 +0100
committergingerBill <bill@gingerbill.org>2023-05-22 12:42:02 +0100
commit540f724b1f57d0d5a40b65a59f6ee82e070c6ee5 (patch)
treebaf4b0584ebac85e423626a6503d0fa4ca5f27a5 /src/check_expr.cpp
parentd5a8f2298e68c64f2f9e2fe5d0c6ab528db627a8 (diff)
Fix `---` on variable declarations
Diffstat (limited to 'src/check_expr.cpp')
-rw-r--r--src/check_expr.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index e0e74a3aa..20a690e1e 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -5196,10 +5196,13 @@ gb_internal bool check_unpack_arguments(CheckerContext *ctx, Entity **lhs, isize
}
}
- if (allow_undef && rhs[i] != nullptr && rhs[i]->kind == Ast_Undef) {
+ Ast *rhs_expr = unparen_expr(rhs[i]);
+ if (allow_undef && rhs_expr != nullptr && rhs_expr->kind == Ast_Undef) {
+ // NOTE(bill): Just handle this very specific logic here
o.type = t_untyped_undef;
o.mode = Addressing_Value;
o.expr = rhs[i];
+ add_type_and_value(c, rhs[i], o.mode, o.type, o.value);
} else {
check_expr_base(c, &o, rhs[i], type_hint);
}