mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Protocols with a superclass bound written as `protocol P where Self: C` return null from getSuperclass(). Unqualified lookup only cares about getSuperclassDecl(), so serialize that instead. Fixes rdar://problem/124478687.
40 lines
560 B
Swift
40 lines
560 B
Swift
//
|
|
|
|
public protocol Base {}
|
|
|
|
extension Base {
|
|
public func funcInBaseProtocol() {}
|
|
}
|
|
|
|
//
|
|
|
|
public class C: Base {
|
|
public init() {}
|
|
public func funcInClass() {}
|
|
}
|
|
|
|
//
|
|
|
|
public protocol P1: C {}
|
|
|
|
public protocol P2 where Self: C {}
|
|
|
|
public class D: C, P1, P2 {}
|
|
|
|
//
|
|
|
|
public class GenericC<T>: Base {
|
|
public init() {}
|
|
public func funcInClass() {}
|
|
}
|
|
|
|
//
|
|
|
|
public protocol GenericP1: GenericC<Int> {}
|
|
|
|
public protocol GenericP2 where Self: GenericC<Int> {}
|
|
|
|
public class GenericD<T>: GenericC<T> {}
|
|
|
|
extension GenericD: GenericP1, GenericP2 where T == Int {}
|