Skip to content

Commit 69d07f4

Browse files
committed
Try to clarify some of the alternatives a bit
1 parent fb94bf1 commit 69d07f4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

proposals/NNNN-suppressed-associated-types.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -816,9 +816,9 @@ extension Container without Escaping {}
816816
817817
extension Container without Copying, Escaping {} // fully unconstrained in -version
818818
819-
// For generic signatures in other positions, we could have syntax
820-
// that allows you to refer to constraintsets like a member:
821-
func f<T: Container, V: Container>() without T: Container.Copying {}
819+
// We could have syntax that allows you to refer to constraintsets like a member,
820+
// to opt out a generic type parameter from multiple protocol's constrainsets:
821+
func f<T: Container & Filterable>() without T: Container.Copying, Filterable.Copying {}
822822
```
823823
824824
This functionality might also be used for future evolution. Let’s say we add a third suppressable protocol Runcible in the future, and we want to generalize Container to allow for `~Runcible` elements. We can suppress the Runcible requirement on Self and `Self.Element` along with a new default constraint set that reinstates the requirements for existing code. Existing code would continue to apply all of the default sets, and doesn’t know about the new constraint set yet, so would not suppress the newly lifted requirements:

0 commit comments

Comments
 (0)