-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
A rest element type must be an array type.
error regression on 4.5.0-dev.20211003 when using spread expression with a generic that returns a tuple (does not hapen on v4.4.3)
#46183
Comments
A rest element type must be an array type.
error regression on 4.5.0-dev.20211003 (does not hapen on v4.4.3)A rest element type must be an array type.
error regression on 4.5.0-dev.20211003 when using spread expression with generics that return tuples (does not hapen on v4.4.3)
A rest element type must be an array type.
error regression on 4.5.0-dev.20211003 when using spread expression with generics that return tuples (does not hapen on v4.4.3)A rest element type must be an array type.
error regression on 4.5.0-dev.20211003 when using spread expression with generic that returns a tuple (does not hapen on v4.4.3)
A rest element type must be an array type.
error regression on 4.5.0-dev.20211003 when using spread expression with generic that returns a tuple (does not hapen on v4.4.3)A rest element type must be an array type.
error regression on 4.5.0-dev.20211003 when using spread expression with a generic that returns a tuple (does not hapen on v4.4.3)
@weswigham This is caused by #41821. When exploring the constraint of the recursive conditional type |
You think we should return |
I tried returning |
So the reason we get the test failure I mention above when returning |
I'm sort of feeling like maybe simplifications of conditional types (as they occur when exploring constraints of distributive conditional types) shouldn't be counted in the depth (or should count less) because they're never circular and are never the cause of deep recursion. |
We could increase the limit for the mono-directional checks in constraint comparison by making |
Bug Report
π Search Terms
π Version & Regression Information
β― Playground Link
4.5.0-dev.20211003 Playground link (error happens)
v4.4.3 Playground link (no errors)
π» Code
π Actual behavior
Getting a
A rest element type must be an array type.
error for...NTuple<A>
.π Expected behavior
No errors should happen, and no error happens on TypeScript v4.4.3.
The text was updated successfully, but these errors were encountered: