Skip to content

Commit e7921d0

Browse files
authored
Merge pull request #17453 from dan-zheng/generics-manifesto-typo
[Docs] Fix typo in GenericsManifesto.md.
2 parents 8bedc61 + 0f430e5 commit e7921d0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/GenericsManifesto.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -757,9 +757,9 @@ if e1 == e2 { ... } // error: e1 and e2 don't necessarily have the same dynamic
757757
One explicit way to allow such operations in a type-safe manner is to introduce an "open existential" operation of some sort, which extracts and gives a name to the dynamic type stored inside an existential. For example:
758758

759759
```Swift
760-
if let storedInE1 = e1 openas T { // T is a the type of storedInE1, a copy of the value stored in e1
761-
if let storedInE2 = e2 as? T { // is e2 also a T?
762-
if storedInE1 == storedInE2 { ... } // okay: storedInT1 and storedInE2 are both of type T, which we know is Equatable
760+
if let storedInE1 = e1 openas T { // T is the type of storedInE1, a copy of the value stored in e1
761+
if let storedInE2 = e2 as? T { // Does e2 have type T? If so, copy its value to storedInE2
762+
if storedInE1 == storedInE2 { ... } // Okay: storedInT1 and storedInE2 are both of type T, which we know is Equatable
763763
}
764764
}
765765
```

0 commit comments

Comments
 (0)