Skip to content

Inference from rest parameters has strange inconsistent results #37193

Open
@DanielRosenwasser

Description

@DanielRosenwasser
declare function foo(...x: readonly any[]): any

type FooParams = Parameters<typeof foo>;

declare function bar(...x: readonly number[]): any

type BarParams = Parameters<typeof bar>

Expected:

  • FooParams is any[] or readonly any[]
  • BarParams is number[] or readonly number[]

Actual

  • FooParams is unknown[]
  • BarParams is never

Playground link

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs InvestigationThis issue needs a team member to investigate its status.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions