Open
Labels
Needs InvestigationThis issue needs a team member to investigate its status.RescheduledThis issue was previously scheduled to an earlier milestone
Milestone
Description
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
- This changed between versions 4.2.4 and 4.3.2
⏯ 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.
Metadata
Metadata
Assignees
Labels
Needs InvestigationThis issue needs a team member to investigate its status.RescheduledThis issue was previously scheduled to an earlier milestone
Activity
andrewbranch commentedon Sep 1, 2021
Re-opened from #44281, possibly related: #45632, #45576
andrewbranch commentedon Sep 1, 2021
Wesley Wigham (@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.
weswigham commentedon Sep 1, 2021
We did definitely add rules for relating conditional type constraints around then, I think.
andrewbranch commentedon Sep 1, 2021
#37208?
andrewbranch commentedon Sep 1, 2021
Indeed, reverting that “fixes” this issue.
jakearchibald commentedon Sep 7, 2021
I think this issue is impacting a couple of my libraries, as the
IDBValidKeytype references itself.Here's the pattern that's causing a problem. It isn't a problem in 4.3.5.
Downgrading TypeScript due to microsoft/TypeScript#45672
andrewbranch commentedon Oct 11, 2021
Spoke with Wesley Wigham (@weswigham) about this and he mentioned we might be able to apply a targeted fix by swapping the order of checks for conditional types.
1 remaining item
vladzdev commentedon Mar 21, 2022
It looks like the issue was fixed by the version 4.6.2. Isn't it?
jakearchibald commentedon Mar 21, 2022
This example still fails in 4.6.2. Not sure if that's intended.
vladzdev commentedon Mar 21, 2022
I found two deep recursions:
IDBValidKeyandIsExact->DeepMakeRequiredForIsExact.If splits
IDBValidKeyinto two types the error goes away. But they not the same. Not allowed IDBValidKey[][][]... Example.jakearchibald commentedon Mar 21, 2022
But this seemed to work fine in 4.3.5
hasgar-aot commentedon Mar 22, 2022
any fix? it's kind of annoying
v4.0.3
fails in 4.3.5 too.