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

Extending ObjC generics in Swift 3 does not compile

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: Compiler
    • Labels:
      None
    • Environment:

      XCode Version 8.0 (8A218a)

      Description

      ObjC:

      @interface MySet<T : id<NSCopying>> : NSObject
      @end
      

      Swift:

      class Foo { }
      struct Bar { }
          
      extension MySet {
          func foo() -> Foo { return Foo() }
          func bar() -> Bar { return Bar() }
      }
      

      Both of the extension methods result in "Extension of a generic Objective-C class cannot access the class's generic parameters at runtime". However, neither really does anything like that (at least not explicitly).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                courteouselk Anton Bronnikov
              • Votes:
                9 Vote for this issue
                Watchers:
                19 Start watching this issue

                Dates

                • Created:
                  Updated: