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-5939] Type nested in function cannot satisfy operator protocol requirement #48498

Closed
swift-ci opened this issue Sep 20, 2017 · 0 comments
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 3.0 type checker Area → compiler: Semantic analysis unexpected error Bug: Unexpected error

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Sep 20, 2017

Previous ID SR-5939
Radar None
Original Reporter Vermeulen (JIRA User)
Type Bug
Status Resolved
Resolution Duplicate
Environment

Tested on both Swift 3 and Swift 4

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

md5: 1170f2070dc965029c6af37799d7125f

duplicates:

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

Issue Description:

func foo() {
    struct Foo: Equatable { // error: type 'Foo' does not conform to protocol 'Equatable'
        static func == (left: Foo, right: Foo) -> Bool { return true }
    }
}

The problem seems to lie with operators. Instance function or static function requirements work fine.

@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 duplicate Resolution: Duplicates another issue type checker Area → compiler: Semantic analysis conformances Feature → protocol: protocol conformances operators Feature: operators unexpected error Bug: Unexpected error nested types Feature: nested types swift 3.0 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 3.0 type checker Area → compiler: Semantic analysis unexpected error Bug: Unexpected error
Projects
None yet
Development

No branches or pull requests

2 participants