Skip to content

Commit 3d3daa1

Browse files
authored
Merge pull request swiftlang#31346 from dan-zheng/generics-manifesto
2 parents 77d0775 + 53447bf commit 3d3daa1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/GenericsManifesto.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -694,9 +694,9 @@ foo(X())
694694

695695
Under what circumstances should it print "P"? If `foo()` is defined within the same module as the conformance of `X` to `P`? If the call is defined within the same module as the conformance of `X` to `P`? Never? Either of the first two answers requires significant complications in the dynamic casting infrastructure to take into account the module in which a particular dynamic cast occurred (the first option) or where an existential was formed (the second option), while the third answer breaks the link between the static and dynamic type systems--none of which is an acceptable result.
696696

697-
### Conditional conformances via protocol extensions
697+
### Retroactive protocol refinement
698698

699-
We often get requests to make a protocol conform to another protocol. This is, effectively, the expansion of the notion of "Conditional conformances" to protocol extensions. For example:
699+
We often get requests to make protocols retroactively refine other protocols. For example:
700700

701701
```Swift
702702
protocol P {
@@ -707,8 +707,8 @@ protocol Q {
707707
func bar()
708708
}
709709

710-
extension Q : P { // every type that conforms to Q also conforms to P
711-
func foo() { // implement "foo" requirement in terms of "bar"
710+
extension Q : P { // Make every type that conforms to Q also conforms to P
711+
func foo() { // Implement `P.foo` requirement in terms of `Q.bar`
712712
bar()
713713
}
714714
}

0 commit comments

Comments
 (0)