package-private visibility
This commit is contained in:
@@ -842,13 +842,13 @@
|
||||
- this keeps package lookup shallow and deterministic and avoids overloading import aliases with
|
||||
declaration visibility
|
||||
|
||||
36.5. explicit `hide` file-local declarations (implemented)
|
||||
36.5. explicit `hide` package-local declarations (implemented)
|
||||
- `hide name ...` gives any named top-level function, global, native/C record, union, enum,
|
||||
opaque/distinct type, or declaration/type alias the existing file-local semantics
|
||||
opaque/distinct type, or declaration/type alias package-local visibility across sibling files
|
||||
- declarations remain public by default; a leading underscore is an ordinary identifier and `_`
|
||||
remains the write-only sink
|
||||
- hidden native and C declarations with the same name may coexist in separate files, while public
|
||||
collisions are still diagnosed
|
||||
- hidden declarations occupy the package namespace, collide with sibling declarations of the
|
||||
same name, and remain absent from imported package namespaces
|
||||
- `hide` is reserved for named top-level declarations and is rejected on imports, locals,
|
||||
parameters, fields, and anonymous declarations
|
||||
|
||||
|
||||
Reference in New Issue
Block a user