Seems to me some kind of black magic goes on behind the scenes. The example below might not be an MRE, but it's prety intuitive. Experiment with it in the playground.
This was supposed to be a compile-time enforced ipv4 string. Using recursive conditionals we can ensure the desired union type without reaching the limit (> 10K). But it seems that counting recursions doesn't work unless each case is unique.