Files
swift-mirror/test/Serialization/Inputs/class-bound-protocol.swift
Slava Pestov e3d434fbbe Serialization: Serialize ProtocolDecl::getSuperclassDecl() instead of ProtocolDecl::getSuperclass()
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.
2024-03-21 13:09:21 -04:00

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 {}