Closure from KeyPath in Xcode11.4 beta.1

struct Model {
  var name: String {
    get {
      return backing
    }
    set {
      backing = newValue
    }
  }
  var backing: String = "text"
}

let m = Model()

let keyPath = \Model.name
let getterFromKeyPath: (Model) -> String = \Model.name
let getter: (Model) -> String = { $0.name }


print(m[keyPath: keyPath])
print(getterFromKeyPath(m))
print(getter(m))

print(m[keyPath: keyPath])

image

print(getterFromKeyPath(m))

image

print(getter(m))

image