Skip to content

recompose inference broken by #30856 #30942

@sandersn

Description

@sandersn

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 TypeScriptFixedA PR has been merged for this issue

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions