Closed
Description
Caused by the inference change in #30856. Repros in types/recompose/recompose-tests.tsx on line 183. Below is a standalone repro.
Code
type Factory<U> = () => { [P in keyof U]: (props: number) => U[P]; }
declare function withH<U>(fact: Factory<U>): U
const enhancer4: { onChange: (e: any) => void } =
withH(() => ({ onChange: (props) => (e: any) => {} }));
Expected behavior:
enhancer4: { onChange: (e: any) => void }
Actual behavior:
enhancer4: { onChange: unknown }