mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
If the conforming type is generic, we have to treat the conformance as resilient if it is defined outside of the current module. This is because it can resiliently change from being non-dependent to dependent.
36 lines
498 B
Swift
36 lines
498 B
Swift
|
|
public func getVersion() -> Int {
|
|
#if BEFORE
|
|
return 0
|
|
#else
|
|
return 1
|
|
#endif
|
|
}
|
|
|
|
|
|
public protocol BaseProtocol {
|
|
#if AFTER
|
|
associatedtype Assoc = Self
|
|
#endif
|
|
}
|
|
|
|
public protocol DerivedProtocol : BaseProtocol {}
|
|
|
|
|
|
public struct FirstGeneric<T> : BaseProtocol {
|
|
public init() {}
|
|
}
|
|
|
|
public struct SecondGeneric<T> : DerivedProtocol {
|
|
public init() {}
|
|
}
|
|
|
|
extension BaseProtocol {
|
|
public func getMeAType() -> Any.Type {
|
|
#if BEFORE
|
|
return Self.self
|
|
#else
|
|
return Assoc.self
|
|
#endif
|
|
}
|
|
} |