Skip to content

Generics are not propagated in higher order function with constraint #33236

@OliverJAsh

Description

@OliverJAsh

TypeScript Version: 3.5.2, 3.6.2

Search Terms:

Code

const fn = <T extends (param: any) => any>(t: T) => t;

// Workaround:
// const fn = <T extends <A>(param: any) => any>(t: T) => t;

const myGenericFn = <T>(t: T) => t;

// Expected: <T>(t: T) => T
// Actual: (t: any) => any
const result = fn(myGenericFn);

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions