Skip to content

recompose inference broken by #30856 #30942

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 }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions