Ok, at some point we made a big mistake.
Hacker News post about this: https://news.ycombinator.com/item?id=39309783 (source available)
Hacker News post about this: https://news.ycombinator.com/item?id=39309783 (source available)
This is a Typescript type-level computation (which is Turing-complete AFAIK). However this kind of trickery is usually done for fun and to explore how much could be achieved just on the compile step.