Closed
Description
TypeScript Version: 4.1.2
Search Terms:
Code
type BuildTuple<L extends number, T extends any[] = [any]> =
T['length'] extends L ? T : BuildTuple<L, [...T, ...T]>;
type A = BuildTuple<3>
Expected behavior:
The type checker completes in a reasonable time, either by succeeding or by reporting "Type instantiation is excessively deep and possibly infinite".
Actual behavior:
The type checker just hangs.
Playground Link: