@@ -735,8 +735,9 @@ properties in a ``@fixedContents`` struct are implicitly declared
735
735
vice versa.
736
736
- Changing the body of any *existing * methods, initializers, computed property
737
737
accessors, or non-instance stored property accessors is permitted. Changing
738
- the body of a stored instance property observing accessor is only permitted
739
- if the property is not `versioned <versioned entity> `.
738
+ the body of a stored instance property observing accessor is permitted if the
739
+ property is not `versioned <versioned entity> `, and considered a
740
+ `binary-compatible source-breaking change ` if it is.
740
741
- Adding or removing observing accessors from any
741
742
`versioned <versioned entity> ` stored instance properties (public or
742
743
non-public) is not permitted.
@@ -903,11 +904,14 @@ not handle new cases well.
903
904
Protocols
904
905
~~~~~~~~~
905
906
906
- There are very few safe changes to make to protocols:
907
+ There are very few safe changes to make to protocols and their members :
907
908
908
909
- A new non-type requirement may be added to a protocol, as long as it has an
909
910
unconstrained default implementation.
910
911
- A new associated type may be added to a protocol, as long as it has a default.
912
+ As with any other declarations, newly-added associated types must be marked
913
+ with ``@available `` specifying when they were introduced.
914
+ - A default may be added to an associated type.
911
915
- A new optional requirement may be added to an ``@objc `` protocol.
912
916
- All members may be reordered, including associated types.
913
917
- Changing *internal * parameter names of function and subscript requirements
@@ -922,6 +926,8 @@ All other changes to the protocol itself are forbidden, including:
922
926
923
927
- Making an existing requirement optional.
924
928
- Making a non-``@objc `` protocol ``@objc `` or vice versa.
929
+ - Adding or removing constraints from an associated type.
930
+ - Removing a default from an associated type.
925
931
926
932
Protocol extensions may be more freely modified; `see below `__.
927
933
@@ -1162,14 +1168,17 @@ Extensions
1162
1168
Non-protocol extensions largely follow the same rules as the types they extend.
1163
1169
The following changes are permitted:
1164
1170
1165
- - Adding new extensions and removing empty extensions.
1171
+ - Adding new extensions and removing empty extensions (that is, extensions that
1172
+ declare neither members nor protocol conformances).
1166
1173
- Moving a member from one extension to another within the same module, as long
1167
1174
as both extensions have the exact same constraints.
1168
1175
- Moving a member from an unconstrained extension to the declaration of the
1169
1176
base type, provided that the declaration is in the same module. The reverse
1170
1177
is permitted for all members except stored properties, although note that
1171
1178
moving all initializers out of a type declaration may cause a new one to be
1172
1179
implicitly synthesized.
1180
+ - Adding a new protocol conformance (with proper availability annotations).
1181
+ - Removing conformances to non-public protocols.
1173
1182
1174
1183
Adding, removing, reordering, and modifying members follow the same rules as
1175
1184
the base type; see the sections on structs, enums, and classes above.
0 commit comments