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-11482] Some protocols cannot be conformed by code-block-local types #53882

Closed
swift-ci opened this issue Sep 17, 2019 · 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 5.0 type checker Area → compiler: Semantic analysis unexpected error Bug: Unexpected error

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Sep 17, 2019

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

Xcode 10.3 (10G8) (with its default version of Swift 5) on a macOS 10.14.6 system.

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

md5: 2b5818eb169686afb4d2d10ada1048f6

duplicates:

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

Issue Description:

func foo() {
  struct Bar: Comparable {
    static func == (lhs: Bar, rhs: Bar) -> Bool { return true }
    static func < (lhs: Bar, rhs: Bar) -> Bool { return true }
  }
}

The compiler complains about Comparable conformance not being satisfied. But the Equatable conformance works! There's more at the original forum thread.

@belkadan
Copy link
Contributor

I'm pretty sure the Equatable one doesn't work either—you're getting a synthesized implementation rather than the one that's already there.

@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 nested types Feature: nested types unexpected error Bug: Unexpected error swift 5.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 5.0 type checker Area → compiler: Semantic analysis unexpected error Bug: Unexpected error
Projects
None yet
Development

No branches or pull requests

3 participants