Generalizing keypath-to-function conversions

I'd like this bug(?) to be also fixed, when you generalize the conversion between keypath and function.