Skip to content

Fixed Typos #745

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 27, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions proposals/0143-conditional-conformances.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,14 @@ protocol HasIdentity {
}

extension SomeWrapper: Equatable where Wrapped: Equatable {
static func ==(lhs: SomeWrapper<Wrapped>, rhs: SomeWrapper<Wrapper>) -> Bool {
static func ==(lhs: SomeWrapper<Wrapped>, rhs: SomeWrapper<Wrapped>) -> Bool {
return lhs.wrapped == rhs.wrapped
}
}

// error: SomeWrapper already stated conformance to Equatable
extension SomeWrapper: Equatable where Wrapped: HasIdentity {
static func ==(lhs: SomeWrapper<Wrapped>, rhs: SomeWrapper<Wrapper>) -> Bool {
static func ==(lhs: SomeWrapper<Wrapped>, rhs: SomeWrapper<Wrapped>) -> Bool {
return lhs.wrapped === rhs.wrapped
}
}
Expand Down Expand Up @@ -222,7 +222,7 @@ that are orthogonal to conditional conformances.
### Implied conditional conformances

Stating conformance to a protocol implicitly states conformances to
any of the protocols that it the protocol inherits. This is already
any of the protocols that the protocol inherits. This is already
the case in Swift today: one can declare conformance to the
`Collection` protocol, and it implies conformance to `Sequence` as
well.
Expand Down Expand Up @@ -344,13 +344,13 @@ protocol HasIdentity {
}

extension SomeWrapper: Equatable where Wrapped: Equatable {
static func ==(lhs: SomeWrapper<Wrapped>, rhs: SomeWrapper<Wrapper>) -> Bool {
static func ==(lhs: SomeWrapper<Wrapped>, rhs: SomeWrapper<Wrapped>) -> Bool {
return lhs.wrapped == rhs.wrapped
}
}

extension SomeWrapper: Equatable where Wrapped: HasIdentity {
static func ==(lhs: SomeWrapper<Wrapped>, rhs: SomeWrapper<Wrapper>) -> Bool {
static func ==(lhs: SomeWrapper<Wrapped>, rhs: SomeWrapper<Wrapped>) -> Bool {
return lhs.wrapped === rhs.wrapped
}
}
Expand All @@ -373,7 +373,7 @@ It is due to the possibility of #4 occurring that we refer to the two conditiona
```swift
// Possible tie-breaker conformance
extension SomeWrapper: Equatable where Wrapped: Equatable & HasIdentity, {
static func ==(lhs: SomeWrapper<Wrapped>, rhs: SomeWrapper<Wrapper>) -> Bool {
static func ==(lhs: SomeWrapper<Wrapped>, rhs: SomeWrapper<Wrapped>) -> Bool {
return lhs.wrapped == rhs.wrapped
}
}
Expand Down