Skip to content

Commit f6c1070

Browse files
authored
Show example of nested protocols [SE-0404] (#235)
Fixes: rdar://117101695
2 parents 538ea52 + d34032d commit f6c1070

File tree

3 files changed

+107
-230
lines changed

3 files changed

+107
-230
lines changed

TSPL.docc/LanguageGuide/NestedTypes.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
Define types inside the scope of another type.
44

55
Enumerations are often created to support a specific class or structure's functionality.
6-
Similarly, it can be convenient to define utility classes and structures
7-
purely for use within the context of a more complex type.
6+
Similarly, it can be convenient to define utility structures
7+
purely for use within the context of a more complex type,
8+
and protocols that are normally used in conjunction with a specific type.
89
To accomplish this, Swift enables you to define *nested types*,
9-
whereby you nest supporting enumerations, classes, and structures
10+
whereby you nest supporting types like enumerations, structures, and protocols
1011
within the definition of the type they support.
1112

1213
To nest a type within another type,

0 commit comments

Comments
 (0)