diff options
| author | gingerBill <bill@gingerbill.org> | 2022-01-17 21:33:20 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-01-17 21:33:20 +0000 |
| commit | cafb6e5587d4d3f5211b945bcb9d949a3980aa89 (patch) | |
| tree | db33c2794b5aaea22e030e3cc6657404d3d681c5 /src/checker.cpp | |
| parent | e9ae6e20e859eb68b01f3e55ca955a2e08cf446b (diff) | |
Correct `//+private` for `odin doc`
Diffstat (limited to 'src/checker.cpp')
| -rw-r--r-- | src/checker.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/checker.cpp b/src/checker.cpp index ddb73d33e..44dc90c67 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -3446,6 +3446,13 @@ 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; + } + if (entity_visibility_kind != EntityVisiblity_Public && !(c->scope->flags&ScopeFlag_File)) { error(decl, "Attribute 'private' is not allowed on a non file scope entity"); } |