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

[SR-6355] Tuples of Equatable should be Equatable #48905

Closed
an0 mannequin opened this issue Nov 10, 2017 · 1 comment
Closed

[SR-6355] Tuples of Equatable should be Equatable #48905

an0 mannequin opened this issue Nov 10, 2017 · 1 comment
Labels
compiler The Swift compiler in itself conditional conformances Feature → protocol → conformances: conditional conformances conformances Feature → protocol: protocol conformances derived conformances Feature → protocol → conformances: derived conformances aka synthesized conformances duplicate Resolution: Duplicates another issue Equatable Area → standard library: The `Equatable` protocol feature A feature request or implementation swift evolution proposal needed Flag → feature: A feature that warrants a Swift evolution proposal tuples Feature: tuples

Comments

@an0
Copy link
Mannequin

an0 mannequin commented Nov 10, 2017

Previous ID SR-6355
Radar None
Original Reporter @an0
Type Bug
Status Resolved
Resolution Duplicate
Additional Detail from JIRA
Votes 0
Component/s
Labels Bug
Assignee None
Priority Medium

md5: f70a4edbc5c6eadada13b7be9f7df85c

duplicates:

  • SR-1222 A tuple of Equatable types should be Equatable

Issue Description:

SE 0015 offers == overloads for tuples of Equatable. However it is not enough. Multiple Return Values of functions is a great feature of Swift but are very awkward in testing without tuples conforming to Equatable:

XCTAssertEqual((0, 0), (0, 0))

error: cannot invoke 'XCTAssertEqual' with an argument list of type '((Int, Int), (Int, Int))'

Yes, I can use XCTAssert with == instead of XCTAssertEqual as a workaround, but like I said, awkward. It also makes the intention and testing reports less clear.

@belkadan
Copy link
Contributor

We don't have a way to say that a tuple type conforms to a protocol at all.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added duplicate Resolution: Duplicates another issue feature A feature request or implementation swift evolution proposal needed Flag → feature: A feature that warrants a Swift evolution proposal conformances Feature → protocol: protocol conformances derived conformances Feature → protocol → conformances: derived conformances aka synthesized conformances conditional conformances Feature → protocol → conformances: conditional conformances Equatable Area → standard library: The `Equatable` protocol tuples Feature: tuples compiler The Swift compiler in itself and removed bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. labels Jan 29, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler The Swift compiler in itself conditional conformances Feature → protocol → conformances: conditional conformances conformances Feature → protocol: protocol conformances derived conformances Feature → protocol → conformances: derived conformances aka synthesized conformances duplicate Resolution: Duplicates another issue Equatable Area → standard library: The `Equatable` protocol feature A feature request or implementation swift evolution proposal needed Flag → feature: A feature that warrants a Swift evolution proposal tuples Feature: tuples
Projects
None yet
Development

No branches or pull requests

2 participants