@@ -178,14 +178,14 @@ protocol HasIdentity {
178
178
}
179
179
180
180
extension SomeWrapper : Equatable where Wrapped: Equatable {
181
- static func == (lhs : SomeWrapper<Wrapped>, rhs : SomeWrapper<Wrapper >) -> Bool {
181
+ static func == (lhs : SomeWrapper<Wrapped>, rhs : SomeWrapper<Wrapped >) -> Bool {
182
182
return lhs.wrapped == rhs.wrapped
183
183
}
184
184
}
185
185
186
186
// error: SomeWrapper already stated conformance to Equatable
187
187
extension SomeWrapper : Equatable where Wrapped: HasIdentity {
188
- static func == (lhs : SomeWrapper<Wrapped>, rhs : SomeWrapper<Wrapper >) -> Bool {
188
+ static func == (lhs : SomeWrapper<Wrapped>, rhs : SomeWrapper<Wrapped >) -> Bool {
189
189
return lhs.wrapped === rhs.wrapped
190
190
}
191
191
}
@@ -222,7 +222,7 @@ that are orthogonal to conditional conformances.
222
222
### Implied conditional conformances
223
223
224
224
Stating conformance to a protocol implicitly states conformances to
225
- any of the protocols that it the protocol inherits. This is already
225
+ any of the protocols that the protocol inherits. This is already
226
226
the case in Swift today: one can declare conformance to the
227
227
` Collection ` protocol, and it implies conformance to ` Sequence ` as
228
228
well.
@@ -344,13 +344,13 @@ protocol HasIdentity {
344
344
}
345
345
346
346
extension SomeWrapper : Equatable where Wrapped: Equatable {
347
- static func == (lhs : SomeWrapper<Wrapped>, rhs : SomeWrapper<Wrapper >) -> Bool {
347
+ static func == (lhs : SomeWrapper<Wrapped>, rhs : SomeWrapper<Wrapped >) -> Bool {
348
348
return lhs.wrapped == rhs.wrapped
349
349
}
350
350
}
351
351
352
352
extension SomeWrapper : Equatable where Wrapped: HasIdentity {
353
- static func == (lhs : SomeWrapper<Wrapped>, rhs : SomeWrapper<Wrapper >) -> Bool {
353
+ static func == (lhs : SomeWrapper<Wrapped>, rhs : SomeWrapper<Wrapped >) -> Bool {
354
354
return lhs.wrapped === rhs.wrapped
355
355
}
356
356
}
@@ -373,7 +373,7 @@ It is due to the possibility of #4 occurring that we refer to the two conditiona
373
373
``` swift
374
374
// Possible tie-breaker conformance
375
375
extension SomeWrapper : Equatable where Wrapped: Equatable & HasIdentity , {
376
- static func == (lhs : SomeWrapper<Wrapped>, rhs : SomeWrapper<Wrapper >) -> Bool {
376
+ static func == (lhs : SomeWrapper<Wrapped>, rhs : SomeWrapper<Wrapped >) -> Bool {
377
377
return lhs.wrapped == rhs.wrapped
378
378
}
379
379
}
0 commit comments