Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardTypeScriptrecursive depth limitsSingle-choice MCQ

A tail-recursive type-level counter resolves fine at large `N`, but raising `N` past the tail-recursion budget triggers an error. At roughly which input does TS2589 ("excessively deep") first appear for the tail-recursive accumulator below?

type BuildTuple<N extends number, A extends unknown[] = []> = A['length'] extends N ? A : BuildTuple<N, [...A, unknown]>; type T = BuildTuple<1001>;