@@ -945,8 +945,8 @@ func drawTwiceSome(_ shape: some Shape) -> String {
945
945
```
946
946
947
947
The ` drawTwiceGeneric(_:) ` function
948
- uses a generic type parameter named ` SomeShape ` ,
949
- and explicitly includes the protocol conformance requirement .
948
+ declares a generic type parameter named ` SomeShape ` ,
949
+ with a constraint that requires ` SomeShape ` to conform to the ` Shape ` protocol .
950
950
The ` drawTwiceSome(_:) ` function
951
951
uses the type ` some Shape ` for its argument.
952
952
This creates a new, unnamed, generic type parameter for the function
@@ -973,10 +973,14 @@ but there's no constraint that requires them to be the same type.
973
973
When you call ` combine(shape:with) ` ,
974
974
you can pass two different shapes ---
975
975
in this case, one triangle and one trapezoid.
976
- If you need to write a function
977
- that has multiple generic parameters
978
- and constrain them to be are all the same type,
979
- use the usual generic syntax instead.
976
+
977
+ Unlike the syntax for named generic type parameters,
978
+ described in < docc:Generics > chapter,
979
+ this lightweight syntax can't include
980
+ a generic ` where ` clause or any same-type (` == ` ) constraints.
981
+ In addition,
982
+ using the lightweight syntax for very complex constraints
983
+ can be hard to read.
980
984
981
985
<!--
982
986
This source file is part of the Swift.org open source project
0 commit comments