Skip to content

ReturnType<> broken with never in parameter (please revisit) #35432

Closed
@AnyhowStep

Description

@AnyhowStep

TypeScript Version: 3.7.2

Search Terms:

parameter, never, ReturnType

Code

The AnyFunction type is found here:

export type AnyFunction = (...args: never[]) => void;

export type AnyFunction = (...args: never[]) => void;
//Expected: void
//Actual: any
type x = ReturnType<AnyFunction>;

Expected behavior:

x should be void

Actual behavior:

x is any

Playground Link:

Playground

Related Issues:

Original Issue:
#33457

PR to fix ReturnType<>:
#33496

@jack-williams tracking the never and rest params issue:
#33495

Metadata

Metadata

Assignees

No one assigned

    Labels

    UnactionableThere isn't something we can do with this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions