aboutsummaryrefslogtreecommitdiff
path: root/src/check_stmt.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-12-09 11:37:15 +0000
committergingerBill <bill@gingerbill.org>2022-12-09 11:37:15 +0000
commit144e357fd2cc85d16c04449730c25b0f1aa2390f (patch)
tree7257211ca6f005262e5ecbc592d76327633c79b2 /src/check_stmt.cpp
parentbe22f0d1e1d5bb7c822dd31b1b60d7863fca6264 (diff)
Add extra check
Diffstat (limited to 'src/check_stmt.cpp')
-rw-r--r--src/check_stmt.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp
index 720b15c9c..3fe6699ea 100644
--- a/src/check_stmt.cpp
+++ b/src/check_stmt.cpp
@@ -1949,6 +1949,7 @@ void check_stmt_internal(CheckerContext *ctx, Ast *node, u32 flags) {
entity = alloc_entity_variable(ctx->scope, token, type, EntityState_Resolved);
entity->flags |= EntityFlag_ForValue;
entity->flags |= EntityFlag_Value;
+ entity->identifier = name;
if (i == addressable_index && use_by_reference_for_value) {
entity->flags &= ~EntityFlag_Value;
}
@@ -1973,6 +1974,7 @@ void check_stmt_internal(CheckerContext *ctx, Ast *node, u32 flags) {
if (entity == nullptr) {
entity = alloc_entity_dummy_variable(builtin_pkg->scope, ast_token(name));
+ entity->identifier = name; // might not be an identifier
}
array_add(&entities, entity);