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

Cannot extend PHFetchResult to conform to Sequence in Swift 3

    Details

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

      Description

      extension PHFetchResult: Sequence {
          public func makeIterator() -> NSFastEnumerationIterator {
              return NSFastEnumerationIterator(self)
          }
      }
      

      This used to work in Swift 2 but now in Swift 3 reports this error:
      Extension of a generic Objective-C class cannot access the class's generic parameters at runtime.

      I know it is due to current limitation of the language but is there any temporary workaround?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                an0 Ling Wang
                Reporter:
                an0 Ling Wang
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: