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: README.md
+66Lines changed: 66 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2221,6 +2221,72 @@ _You can enable the following settings in Xcode by running [this script](resourc
2221
2221
2222
2222
</details>
2223
2223
2224
+
*<a id='prefer-opaque-generic-parameters'></a>(<a href='#prefer-opaque-generic-parameters'>link</a>) **Prefer using opaque generic parameters (with `some`) over verbose named generic parameter syntax where possible.** [](https://github.com/nicklockwood/SwiftFormat/blob/master/Rules.md#opaqueGenericParameters)
2225
+
2226
+
<details>
2227
+
2228
+
#### Why?
2229
+
2230
+
Opaque generic parameter syntax is significantly less verbose and thus more legible than the full named generic parameter syntax.
`some Any` is somewhat unintuitive, and the named generic parameter is useful in this situation to compensate for the weak type information. Because of this, prefer using named generic parameters instead of `some Any`.
0 commit comments