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-6526] Can't conform a type declared inside a function to Equatable #49076

Closed
hartbit opened this issue Dec 4, 2017 · 1 comment
Closed
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself conformances Feature → protocol: protocol conformances duplicate Resolution: Duplicates another issue nested types Feature: nested types operators Feature: operators swift 4.0 type checker Area → compiler: Semantic analysis unexpected error Bug: Unexpected error

Comments

@hartbit
Copy link
Collaborator

hartbit commented Dec 4, 2017

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

Xcode 9.1 (9B55)

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

md5: fb096e9bc4169fc9bbcf35e80ff44420

duplicates:

  • SR-3092 Function-level nested types cannot conform to Equatable

Issue Description:

func foo() {
    struct Inner: Equatable { // error: Type 'Inner' does not conform to protocol 'Equatable'
        let prop: Int

        static func ==(lhs: Inner, rhs: Inner) -> Bool {
            return lhs.prop == rhs.prop
        }
    }
}
@belkadan
Copy link
Contributor

belkadan commented Dec 4, 2017

Yep. :-(

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis closed this as not planned Won't fix, can't repro, duplicate, stale Jun 3, 2022
@AnthonyLatsis AnthonyLatsis added swift 4.0 duplicate Resolution: Duplicates another issue type checker Area → compiler: Semantic analysis conformances Feature → protocol: protocol conformances operators Feature: operators nested types Feature: nested types unexpected error Bug: Unexpected error labels Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself conformances Feature → protocol: protocol conformances duplicate Resolution: Duplicates another issue nested types Feature: nested types operators Feature: operators swift 4.0 type checker Area → compiler: Semantic analysis unexpected error Bug: Unexpected error
Projects
None yet
Development

No branches or pull requests

3 participants