I don't know about the typescript compiler, but the way around template recursion limits in "classic" C++ template metaprogramming is to figure out a way to make it O(log N) depth instead of O(N) (for some value of N). Like instead of linearly iterating through a range of types through recursion, you divide and conquer. Easier said than done, but possible in some cases.