aboutsummaryrefslogtreecommitdiff
path: root/src/checker.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-02-02 15:28:49 +0000
committergingerBill <bill@gingerbill.org>2022-02-02 15:28:49 +0000
commit78815778ee399b4df1c5f7c44522c792b9dc3e23 (patch)
tree884c8a2a459ff9068daac89a63ced2e160564ea9 /src/checker.cpp
parenta04d849e30da1252e56d29ee18e2a51a5b6cb0d5 (diff)
Add `//+private file` to complement `//+private` (`//+private package`)
Diffstat (limited to 'src/checker.cpp')
-rw-r--r--src/checker.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/checker.cpp b/src/checker.cpp
index d50d4d176..4dcb5120f 100644
--- a/src/checker.cpp
+++ b/src/checker.cpp
@@ -3467,9 +3467,12 @@ void check_collect_value_decl(CheckerContext *c, Ast *decl) {
if (entity_visibility_kind == EntityVisiblity_Public &&
(c->scope->flags&ScopeFlag_File) &&
- c->scope->file &&
- (c->scope->file->flags & AstFile_IsPrivate)) {
- entity_visibility_kind = EntityVisiblity_PrivateToPackage;
+ c->scope->file) {
+ if (c->scope->file->flags & AstFile_IsPrivatePkg) {
+ entity_visibility_kind = EntityVisiblity_PrivateToPackage;
+ } else if (c->scope->file->flags & AstFile_IsPrivateFile) {
+ entity_visibility_kind = EntityVisiblity_PrivateToFile;
+ }
}
if (entity_visibility_kind != EntityVisiblity_Public && !(c->scope->flags&ScopeFlag_File)) {