Skip to content

Commit e674ab8

Browse files
author
Harlan Haskins
committed
[docs] Note that adding associatedtypes with defaults is allowed in library evolution
It is actually valid to add an `associatedtype` requirement, even one with constraints, to an existing protocol, provided it has availability and a default value.
1 parent 9eb9b8d commit e674ab8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/LibraryEvolution.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,8 @@ There are very few safe changes to make to protocols and their members:
577577
themselves).
578578
- The ``@discardableResult`` and ``@warn_unqualified_access`` attributes may
579579
be added to or removed from a function requirement.
580+
- A new `associatedtype` requirement may be added (with the appropriate
581+
availability), as long as it has a default implementation.
580582
- A new non-type requirement may be added (with the appropriate availability),
581583
as long as it has an unconstrained default implementation. If the requirement
582584
uses ``Self`` and the protocol has no other requirements using ``Self`` and

0 commit comments

Comments
 (0)