Skip to content

[SR-2708] Extending ObjC generics in Swift 3 does not compile #45312

Open
@swift-ci

Description

@swift-ci
Previous ID SR-2708
Radar None
Original Reporter courteouselk (JIRA User)
Type Bug
Environment

XCode Version 8.0 (8A218a)

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

md5: 2fa4d679d5ba96de70dc71c058d5ab46

relates to:

  • SR-3328 Cannot extend PHFetchResult to conform to Sequence in Swift 3

Issue 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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itself

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions