@@ -349,7 +349,8 @@ the following changes are permitted:
349
349
350
350
- Reordering any existing members, including stored properties (unless the
351
351
struct is marked ``@frozen ``; see below).
352
- - Adding any new members, including stored properties.
352
+ - Adding any new members, including stored properties (see below for an
353
+ exception).
353
354
- Changing existing properties from stored to computed or vice versa (unless the
354
355
struct is marked ``@frozen ``; see below).
355
356
- As a special case of the above, adding or removing ``lazy `` from a stored
@@ -370,6 +371,9 @@ change even with Swift's synthesis of memberwise and no-argument initializers;
370
371
these initializers are always ``internal `` and thus not exposed to clients
371
372
outside the module.
372
373
374
+ Adding a new stored property with availability newer than the deployment
375
+ target for the library is an error.
376
+
373
377
It is not safe to add or remove ``mutating `` or ``nonmutating `` from a member
374
378
or accessor within a struct.
375
379
@@ -507,9 +511,10 @@ without breaking binary compatibility. As with structs, this results in a fair
507
511
amount of indirection when dealing with enum values, in order to potentially
508
512
accommodate new values. More specifically, the following changes are permitted:
509
513
510
- - Adding a new case (unless the enum is marked ``@frozen ``; see below).
514
+ - Adding a new case (see below for exceptions around ``@frozen `` and
515
+ availability).
511
516
- Reordering existing cases is a `binary-compatible source-breaking change `
512
- (unless the struct is marked ``@frozen ``; see below). In particular, both
517
+ (unless the enum is marked ``@frozen ``; see below). In particular, both
513
518
CaseIterable and RawRepresentable default implementations may affect client
514
519
behavior.
515
520
- Adding a raw type to an enum that does not have one.
@@ -526,6 +531,10 @@ accommodate new values. More specifically, the following changes are permitted:
526
531
representation for the value, just as it may discard fields of structs that
527
532
are provably never accessed.
528
533
534
+ Adding a new case with one or more associated values and with availability
535
+ newer than the deployment target for the library is an error.
536
+ This limitation is similar to the limitation for stored properties on structs.
537
+
529
538
Adding or removing the ``@objc `` attribute from an enum is not permitted; this
530
539
affects the enum's memory representation and is not backwards-compatible.
531
540
0 commit comments