You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: TSPL.docc/LanguageGuide/OpaqueTypes.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -498,7 +498,7 @@ A boxed protocol type is also sometimes called an *existential type*,
498
498
which comes from the phrase
499
499
"there exists a type *T* such that *T* conforms to the protocol".
500
500
To make a boxed protocol type,
501
-
write `any` before the name of a protocol.
501
+
write `any` before the name of a protocol (or protocol composition).
502
502
Here's an example:
503
503
504
504
```swift
@@ -621,9 +621,9 @@ if let downcastTriangle = vertical.shapes[0] as? Triangle {
621
621
622
622
For more information, see <doc:TypeCasting#Downcasting>.
623
623
624
-
### Existential Of Composed Protocol Type
624
+
### Existential Of Protocol Composition
625
625
626
-
An existential can also creating by writing `any` before a composed protocol type (see <doc:Protocols#Protocol-Composition>). This creates a box which holds a structure, class or enum that conforms to all the protocols listed.
626
+
An existential can also creating by writing `any` before a protocol composition (see <doc:Protocols#Protocol-Composition>). This creates a box which holds a structure, class or enum that conforms to all the protocols listed.
0 commit comments