mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
We would previously hide the protocol, its extensions and members, but the '_' prefix really just means the protocol itself isn't intended for clients, rather than its members. This also adds support for 'fully_annotated_decl' entries in doc-info for extensions to be consistent with every other decl, and removes the 'fully_annotated_generic_signature' entry we supplied as a fallback. Also fixes several bugs with the synthesized extensions mechanism: - The type sustitutions applied to the extension's requirements were computed using the extension itself as the decl context rather than the extension's nominal. The meant the extension's requirements themselves were assumed to hold when determining the substitutions, so equality constraints were always met. Because of this extension members were incorrectly merged with the base nominal or its extensions despite having additional constraints. - Types within the requirements weren't being transformed when printed (e.g. 'Self.Element' was printed rather than 'T') both in the interface output and in the requirements list. We were also incorrectly printing requirements that were already satisfied once the base type was subsituted in. - If both the protocol extension and 'enabling' extension of the base nominal that added the protocol conformance had conditional requirements, we were only printing the protocol extension's requirements in the synthesized extension. - The USR and annotated decl output embedded in the 'key.doc.full_as_xml' string for synthesized members were printed to match their original context, rather than the synthesized one. Resolves rdar://problem/57121937
102 lines
2.3 KiB
Plaintext
102 lines
2.3 KiB
Plaintext
// swift-interface-format-version: 1.0
|
|
// swift-module-flags: -swift-version 5 -enable-library-evolution -module-name UnderscoredProto
|
|
|
|
public protocol _UnderscoredProto {}
|
|
public protocol _UnderscoredProto2 {
|
|
associatedtype Elem
|
|
}
|
|
|
|
public extension _UnderscoredProto {
|
|
func fromProtoExtension()
|
|
}
|
|
|
|
public extension _UnderscoredProto2 {
|
|
func fromProto2Extension(takesElem: Elem)
|
|
}
|
|
|
|
@available(*, deprecated, message: "")
|
|
public extension _UnderscoredProto {
|
|
func fromDeprecatedProtoExtension(){}
|
|
}
|
|
|
|
public extension _UnderscoredProto2 where Elem == String {
|
|
func fromConditionalProto2Extension(takesElemIfString: Elem)
|
|
}
|
|
|
|
@available(*, deprecated, message: "")
|
|
public extension _UnderscoredProto2 where Elem == Int {
|
|
func fromDeprecatedConditionalProto2Extension(takesElemInt: Elem)
|
|
}
|
|
|
|
public struct A<T> {
|
|
public func fromA(takesT: T)
|
|
}
|
|
|
|
extension A {
|
|
public func fromAExtension(takesT: T)
|
|
}
|
|
|
|
extension A : _UnderscoredProto {}
|
|
|
|
extension A : _UnderscoredProto2 where T == String {
|
|
public typealias Elem = Int
|
|
public func fromAConditionalExtension(takesTIfString: T)
|
|
}
|
|
|
|
public class B<T>: _UnderscoredProto {
|
|
public func fromB(takesT: T)
|
|
}
|
|
|
|
extension B: _UnderscoredProto2 {
|
|
public typealias Elem = String
|
|
}
|
|
|
|
public class C<U,V>: B<String> where U: Equatable {
|
|
public func fromC(takesUIfEquatable: U)
|
|
}
|
|
|
|
public protocol _UnderscoredProto3 {
|
|
associatedtype Elem1
|
|
associatedtype Elem2
|
|
}
|
|
extension _UnderscoredProto3 {
|
|
public func fromProto3Extension(takesElem1: Elem1)
|
|
public func fromProto3Extension(takesElem2: Elem2)
|
|
}
|
|
|
|
public protocol _UnderscoredProto4: _UnderscoredProto3 where Elem2: Equatable {}
|
|
extension _UnderscoredProto4 {
|
|
public func fromProto4Extension(takesElem2IfEquatable: Elem2)
|
|
}
|
|
|
|
extension _UnderscoredProto4 where Elem2: Hashable {
|
|
public func fromProto4Extension(takesElem2IfHashable: Elem2)
|
|
}
|
|
|
|
extension C: _UnderscoredProto4 {
|
|
public typealias Elem1 = V
|
|
public typealias Elem2 = U
|
|
public func fromCConditionlExtension(takesU: U)
|
|
}
|
|
|
|
|
|
public struct D<T, U> {
|
|
public func fromD(takesT: T, takesU: U)
|
|
}
|
|
|
|
public protocol Other1 {}
|
|
public protocol _SomeProto {
|
|
associatedtype Item
|
|
}
|
|
|
|
extension _SomeProto where Item: Other1 {
|
|
public func fromSomeProtoExtensionSplitConditions(takesItemIfOther1: Item)
|
|
}
|
|
|
|
extension D: _SomeProto where T: Equatable {
|
|
public typealias Item = T
|
|
|
|
}
|
|
|
|
|