Files
swift-mirror/test/Inputs/resilient_protocol.swift
Slava Pestov 53b3a69a9a Runtime: Fix dynamic casts to support resilient protocols
If a protocol witness table requires instantiation, the runtime
needs to call the witness table accessor when looking up the
conformance in swift_conformsToProtocol().

We had a bit of code for this already, but it wasn't fully
hooked up. Change IRGen to emit a reference to the witness table
accessor rather than the witness table itself if the witness
table needs instantiation, and add support to the runtime for
calling the accessor.
2016-09-30 18:28:11 -07:00

24 lines
432 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 {}