Spot the bug: template flattenedType(R, uint depth = uint.max) if (isInputRange!R) { static if (depth > 0) { static if (!isInputRange!(typeof(R.init.front))) { alias flattenedType = typeof(R.init.front, depth - 1); } else {alias flattenedType = flattenedType!(typeof(R.init.front), depth - 1);
} } else { alias flattenedType = typeof(R.init.front); } }
I'll give you a hint: the bug causes flattenedType!R to always returned uint.