Files
swift-mirror/test/Inputs/resilient_protocol.swift
Slava Pestov 71ab1bbe77 IRGen: Fix isResilientConformance() check
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.
2019-02-20 20:00:46 -05:00

43 lines
900 B
Swift

public protocol OtherResilientProtocol {
}
var x: Int = 0
extension OtherResilientProtocol {
public var propertyInExtension: Int {
get { return x }
set { x = newValue }
}
public static var staticPropertyInExtension: Int {
get { return x }
set { x = newValue }
}
}
public protocol ResilientBaseProtocol {
func requirement() -> Int
}
public protocol ResilientDerivedProtocol : ResilientBaseProtocol {}
public protocol ProtocolWithRequirements {
associatedtype T
func first()
func second()
}
public struct Wrapper<T>: OtherResilientProtocol { }
public struct ConcreteWrapper: OtherResilientProtocol { }
public protocol ProtocolWithAssocTypeDefaults {
associatedtype T1 = Self
associatedtype T2: OtherResilientProtocol = Wrapper<T1>
}
public protocol ResilientSelfDefault : ResilientBaseProtocol {
associatedtype AssocType: ResilientBaseProtocol = Self
}