Files
swift-mirror/test/IRGen/Inputs/ResilientBase.swift
Arnold Schwaighofer 87820b4c22 IRGen: Map interface to archetypes in keypath function
We are building the class layout based on this type which expects archetypes.

rdar://61751511
2020-04-17 15:51:36 -07:00

35 lines
737 B
Swift

@propertyWrapper
public struct Wrapper<Value> {
var value: Value
public init(wrappedValue: Value) {
self.init(initialValue: wrappedValue)
}
public init(initialValue: Value) {
value = initialValue
}
public var wrappedValue: Value {
get { fatalError("unreachable") }
set { fatalError("unreachable") }
}
public static subscript<T: AnyObject>(
_enclosingInstance object: T,
wrapped wrappedKeyPath: ReferenceWritableKeyPath<T, Value>,
storage storageKeyPath: ReferenceWritableKeyPath<T, Self>
) -> Value {
get {
object[keyPath: storageKeyPath].value
}
set {
object[keyPath: storageKeyPath].value = newValue
}
}
}
open class ResilientBase {
public init() {}
}