Skip to content

Commit 6943d5f

Browse files
authored
Reword extensions in access control (#315)
Breaking this up into bullets and rewording should make it easier to read.
2 parents ef8232d + e5e2726 commit 6943d5f

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

TSPL.docc/ReferenceManual/Declarations.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3940,14 +3940,21 @@ Access control is discussed in detail in <doc:AccessControl>.
39403940
only by code within the declaration's immediate enclosing scope.
39413941

39423942
For the purpose of access control,
3943-
extensions to the same type that are in the same file
3944-
share an access-control scope.
3945-
If the type they extend is also in the same file,
3946-
they share the type's access-control scope.
3947-
Private members declared in the type's declaration
3948-
can be accessed from extensions,
3949-
and private members declared in one extension
3950-
can be accessed from other extensions and from the type's declaration.
3943+
extensions behave as follows:
3944+
3945+
- If there are multiple extensions in the same file,
3946+
and those extensions all extend the same type,
3947+
then all of those extensions have the same access-control scope.
3948+
The extensions and the type they extend can be in different files.
3949+
3950+
- If there are extensions in the same file as the type they extend,
3951+
the extensions have the same access-control scope as the type they extend.
3952+
3953+
- Private members declared in a type's declaration
3954+
can be accessed from extensions to that type.
3955+
Private members declared in one extension
3956+
can be accessed from other extensions
3957+
and from the extended type's declaration.
39513958

39523959
Each access-level modifier above optionally accepts a single argument,
39533960
which consists of the `set` keyword enclosed in parentheses ---

0 commit comments

Comments
 (0)