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-6802] Tuples of Equatable types aren't Equatable #49351

Closed
NachoSoto opened this issue Jan 20, 2018 · 0 comments
Closed

[SR-6802] Tuples of Equatable types aren't Equatable #49351

NachoSoto opened this issue Jan 20, 2018 · 0 comments
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

@NachoSoto
Copy link
Contributor

Previous ID SR-6802
Radar None
Original Reporter @NachoSoto
Type Bug
Status Resolved
Resolution Duplicate
Environment

Swift version 4.1-dev (LLVM ef53654946, Clang f7df1e5a04, Swift 831b78c)

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, TypeChecker
Assignee None
Priority Medium

md5: 5aaf6cd5b4a38cd8f897ea295227a431

duplicates:

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

Issue Description:

With the introduction of conditional conformance, this remains the last issue to finally get to a point where we don't need to implement Equatable manually.

Consider this:

enum B: Equatable {
    case b1([(String, String)])
}

The error you get is (which I also filed SR-6801 for):

error: type 'B' does not conform to protocol 'Equatable'

I would expect this to work.

Fortunately we do have a temporary workaround:

enum B: Equatable {
    struct T: Equatable {
        let a: String
        let b: String
    }

    case b1([T])
}
@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 tuples Feature: tuples Equatable Area → standard library: The `Equatable` protocol and removed bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. type checker Area → compiler: Semantic analysis 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