Flat typedef: type instantiation is excessively deep and possibly infinite
See original GitHub issueProblem in src/__spec__/flat.spec.ts
:
// flat(0, iterable)
assert<{
'depth = 0': IterableIterator<0 | 1 | 2>
// ...
}>({
'depth = 0': iter.flat(0, [0, 1, 2] as [0, 1, 2]), // Type instantiation is excessively deep and possibly infinite
// ...
})
@KSXGitHub says this is an underlying issue in typescript-tuple
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Type instantiation is excessively deep and possibly infinite ...
So I tried to model an alternative ChainNode type purely based on the output types you showed in your question.
Read more >Type instantiation is excessively deep and possibly infinite in ...
Expected behavior: No error is thrown. Actual behavior: Type instantiation is excessively deep and possibly infinite.ts(2589) error is thrown.
Read more >TypeScript. Type instantiation is excessively deep ... - Ilya Zykin
Type instantiation is excessively deep and possibly infinite. How to fix. I've just started a migration to TypeScript. I see many unknown and...
Read more >Jamon on Twitter: "I can't not brag about this — I solved a ...
An unintuitive error (“Type instantiation is excessively deep and possibly infinite”). Fixed by casting the type (IMessage) to the generic “ ...
Read more >Type instantiation is excessively deep and possibly infinite ...
Getting `Type instantiation is excessively deep and possibly infinite` errors whenever I pass MongoClient as a parameter in my code after ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think we should follow the lead of the official typescript defs: https://github.com/microsoft/TypeScript/blob/d484163d0f8445aa7e1e7b944550922e99cf8305/lib/lib.es2019.array.d.ts#L45
I think any overload that has
shouldFlat
should returnIterable<any>
.The only tricky thing will be that we’ll need even more duplication than we have to support our curried/uncurried versions.
Fixed in 7.x