Skip to content

const type parameters don't work with mutable array constraintsΒ #51931

@diegohaz

Description

@diegohaz

Bug Report

I'm not sure if this is intended behavior. If this is not a bug, I'd suggest supporting this as a feature.

πŸ”Ž Search Terms

const, args, generic args, extends

πŸ•— Version & Regression Information

v5.0.0

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

declare function fn<const T extends any[]>(...args: T): T;

const a = fn("a", false);

πŸ™ Actual behavior

The return type is any[]

πŸ™‚ Expected behavior

The return type should be ["a", false]

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions