aboutsummaryrefslogtreecommitdiff
path: root/src/checker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/checker.cpp')
-rw-r--r--src/checker.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/checker.cpp b/src/checker.cpp
index 5299e4372..a7b54fb8a 100644
--- a/src/checker.cpp
+++ b/src/checker.cpp
@@ -905,11 +905,14 @@ void add_entity_and_decl_info(CheckerContext *c, Ast *identifier, Entity *e, Dec
if (e->scope != nullptr) {
Scope *scope = e->scope;
- if ((scope->flags&ScopeFlag_File) && is_entity_kind_exported(e->kind)) {
- AstPackage *pkg = scope->file->pkg;
- GB_ASSERT(pkg->scope == scope->parent);
- GB_ASSERT(c->pkg == pkg);
- scope = pkg->scope;
+
+ if (scope->flags & ScopeFlag_File) {
+ if (is_entity_kind_exported(e->kind)) {
+ AstPackage *pkg = scope->file->pkg;
+ GB_ASSERT(pkg->scope == scope->parent);
+ GB_ASSERT(c->pkg == pkg);
+ scope = pkg->scope;
+ }
}
add_entity(c->checker, scope, identifier, e);
}