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-2020] Protocol composition doesn't conform to associated type requirement #44629

karwa opened this issue Jul 7, 2016 · 0 comments


Copy link

@karwa karwa commented Jul 7, 2016

Previous ID SR-2020
Radar None
Original Reporter @karwa
Type Bug
Status Resolved
Resolution Duplicate

Xcode 8 beta 2

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

md5: e50bcda9ba2a2e6332ea7791978266a3


  • SR-55 non-@objc protocol existentials do not conform to their own protocol type

relates to:

  • SR-629 Protocol composition types should be covariant with composing protocols for protocol conformance
  • SR-1581 Can not use protocol to fulfill associatedtype requirement where associatedType has protocol constraint

Issue Description:

protocol SettingsFile {}
protocol SpecificSettingsProvider {}     // NOTE: This doesn't inherit SettingsFile, on purpose. We use a composition instead.

protocol SettingsFileInfo {
    associatedtype FileType : SettingsFile

struct SpecificSettingsFileInfo : SettingsFileInfo {
    typealias FileType = protocol<SettingsFile, SpecificSettingsProvider>

Gives an error that SpecificSettingsFileInfo doesn't conform to SettingsFileInfo because FileType doesn't conform to SettingsFile.

@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
None yet

No branches or pull requests

1 participant