aboutsummaryrefslogtreecommitdiff
path: root/src/check_stmt.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-03-19 17:02:01 +0000
committergingerBill <bill@gingerbill.org>2024-03-19 17:02:01 +0000
commit83dcce9a58c72f9f4e079aae8e06e932773ec8e2 (patch)
tree92381999f6d0033b1566bf1f549c74e147d847ed /src/check_stmt.cpp
parentcc62773a05cb6c7a00cfcb916da1b6fdde7de3e8 (diff)
parent433109ff52d2db76069273cd53b7aebf6aea9be0 (diff)
Merge branch 'master' into orca-dev
Diffstat (limited to 'src/check_stmt.cpp')
-rw-r--r--src/check_stmt.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp
index db3355999..e03628092 100644
--- a/src/check_stmt.cpp
+++ b/src/check_stmt.cpp
@@ -1919,17 +1919,19 @@ gb_internal void check_value_decl_stmt(CheckerContext *ctx, Ast *node, u32 mod_f
e->Variable.thread_local_model = ac.thread_local_model;
}
- if (is_arch_wasm() && e->Variable.thread_local_model.len != 0) {
- // error(e->token, "@(thread_local) is not supported for this target platform");
- }
-
-
if (ac.is_static && ac.thread_local_model != "") {
error(e->token, "The 'static' attribute is not needed if 'thread_local' is applied");
}
}
+ // NOTE(bill): This is to improve error handling for things like `x: [?]T = {...}`
+ Ast *prev_type_hint_expr = ctx->type_hint_expr;
+ ctx->type_hint_expr = vd->type;
+
check_init_variables(ctx, entities, entity_count, vd->values, str_lit("variable declaration"));
+
+ ctx->type_hint_expr = prev_type_hint_expr;
+
check_arity_match(ctx, vd, false);
for (isize i = 0; i < entity_count; i++) {