Skip to content
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

Equatable tweaks #108

Merged
merged 1 commit into from
Jul 22, 2018
Merged

Equatable tweaks #108

merged 1 commit into from
Jul 22, 2018

Conversation

ikesyo
Copy link
Member

@ikesyo ikesyo commented Jul 21, 2018

  • Utilize conditional conformances
  • Utilize synthesizing Equatable conformance

- Utilize conditional conformances
- Utilize synthesizing Equatable conformance
@@ -33,18 +33,3 @@ extension TaskError: CustomStringConvertible {
}
}
}

extension TaskError: Equatable {
Copy link
Member

@tmspzz tmspzz Jul 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this auto synthesized now? from TaskError: Error, Equatable ?

I saw no tests for this. Do you think it's necessary to add one?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this auto synthesized now? from TaskError: Error, Equatable ?

Yes

I saw no tests for this. Do you think it's necessary to add one?

Nah. This is tested in the compiler.

@@ -88,19 +88,6 @@ extension Task: Hashable {
}
}

private func ==<Key, Value: Equatable>(lhs: [Key: Value]?, rhs: [Key: Value]?) -> Bool {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was removed because of auto inference of equality?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Key: Value]? is Equatable automatically now because Optional and Dictionary both have conditional Equatable conformances.

@@ -33,18 +33,3 @@ extension TaskError: CustomStringConvertible {
}
}
}

extension TaskError: Equatable {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this auto synthesized now? from TaskError: Error, Equatable ?

Yes

I saw no tests for this. Do you think it's necessary to add one?

Nah. This is tested in the compiler.

@@ -88,19 +88,6 @@ extension Task: Hashable {
}
}

private func ==<Key, Value: Equatable>(lhs: [Key: Value]?, rhs: [Key: Value]?) -> Bool {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Key: Value]? is Equatable automatically now because Optional and Dictionary both have conditional Equatable conformances.

@mdiep mdiep merged commit 6771f8c into master Jul 22, 2018
@mdiep mdiep deleted the equatable-tweaks branch July 22, 2018 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants