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

Add rule to disallow recursive conditional types #640

Open
ajafff opened this issue Jul 19, 2019 · 1 comment
Open

Add rule to disallow recursive conditional types #640

ajafff opened this issue Jul 19, 2019 · 1 comment

Comments

@ajafff
Copy link
Member

ajafff commented Jul 19, 2019

microsoft/TypeScript#26223 (comment)

This style of construct: type A<T> = { 0: X, 1: A<B<T>>}[A extends Y ? 0 : 1] is not supported; if you use it in production code, do not be surprised if it gives unexpected or broken results in some environments... and any such code should probably feature prominent warnings to that effect.

@ajafff
Copy link
Member Author

ajafff commented Jan 6, 2021

TypeScript now officially supports recursive conditional types and became better at detecting recursion.
I wonder if this specific pattern still causes issues?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant