aboutsummaryrefslogtreecommitdiff
path: root/src/checker.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-01-17 11:59:51 +0000
committergingerBill <bill@gingerbill.org>2021-01-17 11:59:51 +0000
commit2990b3efd56dbf8733f8b118ec11b2a628c22a50 (patch)
tree01a5a3331307165de5e4d0126f7e938e84b0aa9f /src/checker.cpp
parentc653e400dbb011965583a34951763173b0fc7969 (diff)
Fix #825
Diffstat (limited to 'src/checker.cpp')
-rw-r--r--src/checker.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/checker.cpp b/src/checker.cpp
index c1a107c15..1e1eac984 100644
--- a/src/checker.cpp
+++ b/src/checker.cpp
@@ -3419,6 +3419,8 @@ void check_single_global_entity(Checker *c, Entity *e, DeclInfo *d) {
GB_ASSERT(ctx.pkg != nullptr);
GB_ASSERT(e->pkg != nullptr);
+ ctx.decl = d;
+ ctx.scope = d->scope;
if (!e->pkg->used) {
return;
@@ -3437,8 +3439,6 @@ void check_single_global_entity(Checker *c, Entity *e, DeclInfo *d) {
}
}
- ctx.decl = d;
- ctx.scope = d->scope;
check_entity_decl(&ctx, e, d, nullptr);
}
@@ -4438,6 +4438,8 @@ void check_parsed_files(Checker *c) {
add_curr_ast_file(&ctx, f);
check_collect_entities(&ctx, f->decls);
}
+
+ pkg->used = true;
}
TIME_SECTION("import entities");