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-9706] Compiler rejecting conformance #52144

Closed
DevAndArtist mannequin opened this issue Jan 19, 2019 · 0 comments
Closed

[SR-9706] Compiler rejecting conformance #52144

DevAndArtist mannequin opened this issue Jan 19, 2019 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@DevAndArtist
Copy link
Mannequin

DevAndArtist mannequin commented Jan 19, 2019

Previous ID SR-9706
Radar None
Original Reporter @DevAndArtist
Type Bug
Status Closed
Resolution Duplicate
Environment

Xcode 10.1

Apple Swift version 4.2.1 (swiftlang-1000.11.42 clang-1000.11.45.1)

Target: x86_64-apple-darwin18.2.0

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

md5: 5c67fb56b65cf69257cf339beba91f81

duplicates:

  • SR-8028 Protocol with where class constraint fails to compile, but same extension succeeds

Issue Description:

protocol BaseInterface {
  associatedtype Mode: Equatable
}

protocol P {}
class GenericStorage<Mode: Equatable> {}
typealias SpecialStorage<Mode: Equatable> = GenericStorage<Mode> & P

protocol StorageInterface: BaseInterface {
  associatedtype StorageA: GenericStorage<Mode>
  associatedtype StorageB: SpecialStorage<Mode>
}

enum ConcreteMode: Equatable {}

class A: GenericStorage<ConcreteMode> {}
class B: A, P {}

// rejected
struct ConcreteInterface: StorageInterface {
  typealias Mode = ConcreteMode
  typealias StorageA = A
  typealias StorageB = B
}

Discussion thread:
https://forums.swift.org/t/why-is-the-compiler-rejecting-this-conformance/19617

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
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
Projects
None yet
Development

No branches or pull requests

0 participants