Uploaded image for project: 'Swift'
  1. Swift
  2. SR-2020

Protocol composition doesn't conform to associated type requirement

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Duplicate
    • Component/s: Compiler
    • Labels:
      None
    • Environment:

      Xcode 8 beta 2

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                kawa Karl
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: