mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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.
24 lines
432 B
Swift
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 {}
|