Open vlazh opened 3 years ago
Re-opened from #44281, possibly related: #45632, #45576
@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 IDBValidKey
type references itself.
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.
This example still fails in 4.6.2. Not sure if that's intended.
I found two deep recursions: IDBValidKey
and IsExact
-> DeepMakeRequiredForIsExact
.
If splits IDBValidKey
into two types the error goes away. But they not the same. Not allowed IDBValidKey[][][]... Example.
But this seemed to work fine in 4.3.5
any fix? it's kind of annoying v4.0.3 fails in 4.3.5 too.
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