aboutsummaryrefslogtreecommitdiff
path: root/src/entity.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-07-08 15:13:40 +0100
committergingerBill <bill@gingerbill.org>2024-07-08 15:13:40 +0100
commit2a219fa8305f2d246d5b3ae5b2b1e25c75bb4332 (patch)
tree350669a755e9e0d8645f4ff5edf03cd1abb9254d /src/entity.cpp
parent8491e2491cd6fe4ea1b5205614f43f1a525cb77f (diff)
Correct `-use-separate-module` behaviour
Diffstat (limited to 'src/entity.cpp')
-rw-r--r--src/entity.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/entity.cpp b/src/entity.cpp
index 8f55c1faf..9dee9cbe7 100644
--- a/src/entity.cpp
+++ b/src/entity.cpp
@@ -338,6 +338,9 @@ gb_internal Entity *alloc_entity(EntityKind kind, Scope *scope, Token token, Typ
entity->token = token;
entity->type = type;
entity->id = 1 + global_entity_id.fetch_add(1);
+ if (token.pos.file_id) {
+ entity->file = thread_safe_get_ast_file_from_id(token.pos.file_id);
+ }
return entity;
}