-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
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 }
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue