Skip to content

Commit c325b4e

Browse files
committed
[docs] Update LibraryEvolution for 'fileprivate' (SE-0025).
The rules for 'fileprivate' (the old 'private') and the rules for the new "scoped" 'private' are the same.
1 parent f80d68d commit c325b4e

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

docs/LibraryEvolution.rst

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -375,9 +375,8 @@ and the ``x`` and ``y`` properties have now disappeared. To avoid this, the bodi
375375

376376
- They may not define any local types (other than typealiases).
377377

378-
- They must not reference any ``private`` entities, except for those marked
379-
``@always_emit_into_client`` (see below). This includes local functions
380-
defined within the inlineable function.
378+
- They must not reference any ``private`` or ``fileprivate`` entities, except
379+
for those marked ``@always_emit_into_client`` (see below).
381380

382381
- They must not reference any ``internal`` entities except for those that have
383382
been `versioned`_ and those declared ``@always_emit_into_client``. See below
@@ -717,10 +716,9 @@ Fixed-Contents Structs
717716

718717
To opt out of this flexibility, a struct may be marked ``@fixed_contents``.
719718
This promises that no stored properties will be added to or removed from the
720-
struct, even ``private`` or ``internal`` ones. Additionally, all versioned
721-
instance stored properties in a ``@fixed_contents`` struct are implicitly
722-
declared ``@inlineable`` (as described above for top-level variables). In
723-
effect:
719+
struct, even non-public ones. Additionally, all versioned instance stored
720+
properties in a ``@fixed_contents`` struct are implicitly declared
721+
``@inlineable`` (as described above for top-level variables). In effect:
724722

725723
- Reordering all members, including stored properties, is still permitted.
726724
- Adding new stored instance properties (public or non-public) is not permitted.
@@ -751,8 +749,8 @@ generic parameters and members of tuples.
751749
While adding or removing stored properties is forbidden, existing properties may
752750
still be modified in limited ways:
753751

754-
- An existing non-versioned ``internal`` property may be made ``private``, or
755-
vice versa.
752+
- An existing non-public, non-versioned property may change its access level to
753+
any other non-public access level.
756754
- A non-versioned ``internal`` property may be versioned (see `Versioning
757755
Internal Declarations`_).
758756
- A versioned ``internal`` property may be made ``public`` (without changing
@@ -1281,11 +1279,11 @@ Non-public entities declared ``@always_emit_into_client`` may not be versioned.
12811279
declare the minimum version of the library they can be used in, right?
12821280
Syntax?
12831281

1284-
Entities declared ``private`` may not be versioned; the mangled name of such an
1285-
entity includes an identifier based on the containing file, which means moving
1286-
the declaration to another file changes the entity's mangled name. This implies
1287-
that a client would not be able to find the entity at run time if the source
1288-
code is reorganized, which is unacceptable.
1282+
Entities declared ``private`` or ``fileprivate`` may not be versioned; the
1283+
mangled name of such an entity includes an identifier based on the containing
1284+
file, which means moving the declaration to another file changes the entity's
1285+
mangled name. This implies that a client would not be able to find the entity
1286+
at run time if the source code is reorganized, which is unacceptable.
12891287

12901288
.. note::
12911289

0 commit comments

Comments
 (0)