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:
https://www.typescriptlang.org/play?ts=4.1.2#code/C4TwDgpgBAQgrgSwDYBMAqcxIgHgDJQQAewEAdigM5RlwC2ARhAE4A0UahJ5VUAhmRABtALpQAvFCECQIgHwSoAKCiqOQgOTYyAc2AALDWOKkK1AgH4OUAFyxEqDFlx52QgHSe07T+7TyAbiUlUEgoAEFFeGR0TGwcAGY5JSA
TypeScript Version: 4.1.2
Search Terms:
Code
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:
https://www.typescriptlang.org/play?ts=4.1.2#code/C4TwDgpgBAQgrgSwDYBMAqcxIgHgDJQQAewEAdigM5RlwC2ARhAE4A0UahJ5VUAhmRABtALpQAvFCECQIgHwSoAKCiqOQgOTYyAc2AALDWOKkK1AgH4OUAFyxEqDFlx52QgHSe07T+7TyAbiUlUEgoAEFFeGR0TGwcAGY5JSA