Skip to content

Commit 8f37584

Browse files
committed
Add a forward reference for the sugar syntax
1 parent b0f35ec commit 8f37584

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

TSPL.docc/LanguageGuide/Generics.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,14 @@ However, when there isn't a meaningful relationship between them,
286286
it's traditional to name them using single letters such as `T`, `U`, and `V`,
287287
such as `T` in the `swapTwoValues(_:_:)` function above.
288288

289-
> Note: Always give type parameters upper camel case names
290-
> (such as `T` and `MyTypeParameter`)
291-
> to indicate that they're a placeholder for a *type*, not a value.
289+
Use upper camel case names for type parameters,
290+
like `T` and `MyTypeParameter`,
291+
to indicate that they're a placeholder for a *type*, not a value.
292+
293+
> Note:
294+
> If you don't need to name a type parameter or give it any constraints,
295+
> there's an alternate, lightweight syntax you can use instead,
296+
> as described in <doc:OpaqueTypes#Opaque-Parameter-Types>.
292297
293298
## Generic Types
294299

0 commit comments

Comments
 (0)