aboutsummaryrefslogtreecommitdiff
path: root/src/checker.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-02-07 11:37:13 +0000
committergingerBill <bill@gingerbill.org>2022-02-07 11:37:13 +0000
commit3c2ed3bb69df24ba162e5f2ea8f61ee3f7fd8e2f (patch)
tree9b4b0d8f2d28462e3a8f8aa2050917ab7f5d8852 /src/checker.cpp
parent9cbf46e6898a6d60e8e8580aad93773c193ba22f (diff)
Correct `//+private file` bug
Diffstat (limited to 'src/checker.cpp')
-rw-r--r--src/checker.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/checker.cpp b/src/checker.cpp
index b62ef7c4c..7fb4fdb29 100644
--- a/src/checker.cpp
+++ b/src/checker.cpp
@@ -3477,11 +3477,11 @@ void check_collect_value_decl(CheckerContext *c, Ast *decl) {
if (entity_visibility_kind == EntityVisiblity_Public &&
(c->scope->flags&ScopeFlag_File) &&
c->scope->file) {
- if (c->scope->file->flags & AstFile_IsPrivatePkg) {
- entity_visibility_kind = EntityVisiblity_PrivateToPackage;
- } else if (c->scope->file->flags & AstFile_IsPrivateFile) {
+ if (c->scope->file->flags & AstFile_IsPrivateFile) {
entity_visibility_kind = EntityVisiblity_PrivateToFile;
- }
+ } else if (c->scope->file->flags & AstFile_IsPrivatePkg) {
+ entity_visibility_kind = EntityVisiblity_PrivateToPackage;
+ }
}
if (entity_visibility_kind != EntityVisiblity_Public && !(c->scope->flags&ScopeFlag_File)) {