File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed
swift-6-beta.docc/ReferenceManual Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -2336,18 +2336,9 @@ doSomething(with: oneAndTwo)
2336
2336
2337
2337
当在传递给 ` doSomething(_:) ` 的实例上调用 ` log() ` 时,自定义标题会从日志字符串中省略。
2338
2338
2339
- ### Protocol Conformance Must Not Be Redundant
2340
-
2341
- A concrete type can conform to a particular protocol only once.
2342
- Swift marks redundant protocol conformances as an error.
2343
- You're likely to encounter this kind of error
2344
- in two kinds of situations.
2345
- The first situation is when
2346
- you explicitly conform to the same protocol multiple times,
2347
- but with different requirements.
2348
- The second situation is when
2349
- you implicitly inherit from the same protocol multiple times.
2350
- These situations are discussed in the sections below.
2339
+ ### 协议的遵循不应冗余
2340
+
2341
+ 具体类型只能遵从某个协议一次。Swift 会将多余的协议遵从标记为错误。你可能会在两种情况下遇到这种错误。第一种情况是,当你以不同的要求多次显式地遵从同一个协议。第二种情况是,当你多次隐式地继承同一个协议。以下部分将讨论这些情况。
2351
2342
2352
2343
#### Resolving Explicit Redundancy
2353
2344
You can’t perform that action at this time.
0 commit comments