Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Generic type extending an Array can not be used as rest params #38767

Closed
bogdan opened this issue May 25, 2020 · 1 comment
Closed

[Bug] Generic type extending an Array can not be used as rest params #38767

bogdan opened this issue May 25, 2020 · 1 comment
Labels
Duplicate An existing issue was already created

Comments

@bogdan
Copy link

bogdan commented May 25, 2020

TypeScript Version: 3.9.3

Search Terms:

  • Rest element type
  • Generics

Code

type E<T extends any[]> = [...T]

Expected behavior:

No compilation error.

Actual behavior:

2574: A rest element type must be an array type.

Playground Link:

https://www.typescriptlang.org/play?#code/C4TwDgpgBAogPAFShAHsCA7AJgZygQwxAG0BdAPigF4piA6BhUgbgChWg

@ahejlsberg
Copy link
Member

Duplicate of #26113.

@ahejlsberg ahejlsberg added the Duplicate An existing issue was already created label May 25, 2020
@bogdan bogdan closed this as completed May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants