Skip to content

Commit 0b6d0be

Browse files
committed
[docs] LibraryEvolution: Property wrappers, @dynamicCallable...
...and function builders, even though those haven't formally been accepted to the language yet. (This description of property wrappers is also a bit optimistic; at the time of this writing, they haven't been implemented for top-level variables yet.)
1 parent 96f99d2 commit 0b6d0be

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

docs/LibraryEvolution.rst

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ No other changes are permitted; the following are particularly of note:
148148
not they have default arguments.
149149
- An ABI-public function that throws may not become non-throwing or vice versa.
150150
- The ``@escaping`` attribute may not be added to or removed from a parameter.
151+
- Adding or removing a function builder from a parameter is a
152+
`binary-compatible source-breaking change`.
151153

152154

153155
Inlinable Functions
@@ -291,6 +293,11 @@ changes are permitted:
291293
- Adding or removing ``@NSCopying`` to/from a variable.
292294
- If the variable is get-only, or if it has a non-ABI-public setter, it may be
293295
replaced by a ``let`` constant.
296+
- Adding a property wrapper to a variable, or changing from one property
297+
wrapper to another, as long as an ABI-public setter or projected value
298+
(``$foo``) is not removed
299+
- Removing a property wrapper from a variable, as long as the property wrapper
300+
didn't have a projected value (``$foo``).
294301

295302
For an ABI-public module-scope constant declared with ``let``, the following
296303
changes are permitted:
@@ -341,6 +348,7 @@ the following changes are permitted:
341348
- Adding a conformance to an ABI-public protocol *that was introduced in the
342349
same release* (see below).
343350
- Adding or removing a conformance to a non-ABI-public protocol.
351+
- Adding ``@dynamicCallable`` to the struct.
344352

345353
The important most aspect of a Swift struct is its value semantics, not its
346354
layout.
@@ -430,10 +438,11 @@ stored properties also must not have any observing accessors. In effect:
430438
- Adding a new protocol conformance is still permitted, per the usual
431439
restrictions.
432440
- Removing conformances to non-ABI-public protocols is still permitted.
441+
- Adding, changing, or removing property wrappers is not permitted.
433442

434443
Additionally, if the type of any stored instance property includes a struct or
435-
enum, that struct or enum must be ABI-public. This includes generic parameters
436-
and members of tuples.
444+
enum, that struct or enum must be ABI-public. This includes generic parameters,
445+
members of tuples, and property wrappers for stored instance properties.
437446

438447
.. note::
439448

@@ -488,6 +497,7 @@ accommodate new values. More specifically, the following changes are permitted:
488497
- Removing any non-ABI-public members.
489498
- Adding a new protocol conformance, with the same restrictions as for structs.
490499
- Removing conformances to non-ABI-public protocols.
500+
- Adding ``@dynamicCallable`` to the enum.
491501

492502
.. note::
493503

@@ -599,6 +609,7 @@ support all of the following changes:
599609
- Adding a new protocol conformance (subject to the same restrictions as for
600610
structs).
601611
- Removing conformances to non-ABI-public protocols.
612+
- Adding ``@dynamicCallable`` to the class.
602613

603614
Omitted from this list is the free addition of new members. Here classes are a
604615
little more restrictive than structs; they only allow the following changes:
@@ -721,6 +732,14 @@ Variable properties (those declared with ``var``) allow the following changes:
721732
- Adding or removing ``weak`` from a variable with ``Optional`` type.
722733
- Adding or removing ``unowned`` from a variable.
723734
- Adding or removing ``@NSCopying`` from a variable.
735+
- Adding a property wrapper to a non-``open`` variable, or changing from one
736+
property wrapper to another, as long as an ABI-public setter or projected
737+
value (``$foo``) is not removed.
738+
- Adding a property wrapper to an ``open`` variable, or changing from one
739+
property wrapper to another, as long as an ABI-public setter or projected
740+
value (``$foo``) is not added or removed.
741+
- Removing a property wrapper from a variable, as long as the property wrapper
742+
didn't have a projected value (``$foo``).
724743

725744
Adding a public setter to an ``open`` property is a
726745
`binary-compatible source-breaking change`; any existing overrides will not

0 commit comments

Comments
 (0)