mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
20 lines
354 B
Swift
20 lines
354 B
Swift
struct A {
|
|
private(set) var x: Int {
|
|
get { return 0 }
|
|
set {}
|
|
}
|
|
|
|
private(set) subscript(x: Int) -> Int {
|
|
get { return 0 }
|
|
set {}
|
|
}
|
|
}
|
|
|
|
func A_x_keypath() -> WritableKeyPath<A, Int> {
|
|
return \A.x as! WritableKeyPath<A, Int>
|
|
}
|
|
|
|
func A_subscript_0_keypath() -> WritableKeyPath<A, Int> {
|
|
return \A.[0] as! WritableKeyPath<A, Int>
|
|
}
|