ts2556 is too restrictive when generics are involved #57322
Labels
Help Wanted
You can do this
Possible Improvement
The current behavior isn't wrong, but it's possible to see that it might be better in some cases
Milestone
🔎 Search Terms
"generic", "tuple", "spread", "rest", "ts2556", "a spread argument must either have a tuple type or be passed to a rest parameter"
🕗 Version & Regression Information
⏯ Playground Link
https://www.typescriptlang.org/play?#code/CYUwxgNghgTiAEYD2A7AzgF3gMwFzwAoBKeAXgD54A3JAS2AFgAoZ0SWBZdLAD3zijBUEAJ7wA2gF1m2AgDoFPEgHpl8AO5IYAazTNmXTPAwgjpeAB4AKvBA8TKYGngChKURMnkCfeFZIUzPA48ooqakKm8ChIWJo6QA
💻 Code
🙁 Actual behavior
Attempting to spread a generically-typed value whose constraint guarantees tuple-ness into a compatible argument list is forbidden.
🙂 Expected behavior
I should be allowed to do this.
Additional information about the issue
Possibly-related issues:
apply
- unexpected error spreading a union-of-tuples #49802The text was updated successfully, but these errors were encountered: