-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Recursive types error: Type instantiation is excessively deep #45672
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
Comments
@weswigham didn't we start doing more to relate conditional types around that time frame? I seem to recall some increase in these kinds of errors was expected. But this example takes a super long time to even finish checking, and it’s nearly instant in 4.2. |
We did definitely add rules for relating conditional type constraints around then, I think. |
Indeed, reverting that “fixes” this issue. |
I think this issue is impacting a couple of my libraries, as the Here's the pattern that's causing a problem. It isn't a problem in 4.3.5. |
Spoke with @weswigham about this and he mentioned we might be able to apply a targeted fix by swapping the order of checks for conditional types. |
It looks like the issue was fixed by the version 4.6.2. Isn't it? |
This example still fails in 4.6.2. Not sure if that's intended. |
I found two deep recursions: |
But this seemed to work fine in 4.3.5 |
any fix? it's kind of annoying |
Bug Report
I had got error
Type instantiation is excessively deep and possibly infinite.
in my JSON types - value to JSON transformation.It's some new limitation introduced from v4.3.2?
Works fine with v4.2.4.
🕗 Version & Regression Information
⏯ Playground Link
I couldn't get to make a short and simple example because when I removing any recursive type reference then error will disappeared.
Playground link with relevant code
The text was updated successfully, but these errors were encountered: