template Foo(T, uint n = 0) { static if(T.tupleof.length <= n) const char[] Foo = ""; else const char[] Foo = typeof(T.tupleof[n]).stringof ~ " " ~ Foo!(T,n+1); } import std.stdio; void main() { writef("%d, %s\n", __VERSION__, Foo!(S)); /// generates "int, int, int" } struct S { int i; uint j; float k; } for this, the following is a work around: - else const char[] Foo = typeof(T.tupleof[n]).stringof ~ " " ~ Foo!(T,n+1); + else const char[] Foo = typeof(T.tupleof)[n].stringof ~ " " ~ Foo!(T,n+1);
Fixed in 2.023 and 1.039