// RUN: %target-typecheck-verify-swift // rdar://119055010 - greedy key path type assignment breaks keypath-to-function conversion protocol Executable {} final class Wrapper { func update(_ work: (inout Value) throws -> Return) rethrows -> Return { fatalError() } } enum Lookup { func flatMap(_ transform: (Value) throws -> Lookup) rethrows -> Lookup { fatalError() } } protocol Entry { } extension Entry { var executable: Lookup { fatalError() } } func lookup() -> Lookup { fatalError() } struct Test { struct Data { } let value = Wrapper() func run() -> Lookup { value.update { data in let _ = 42 return lookup() } .flatMap(\.executable) } }