May be a duplicate of other tuple bugs. template Foo(T) { alias T Type; } template Foos(A...) { alias A Foos; } alias Foos!(Foo!(int), Foo!(char)) foos; foos[0].Type x = 20; // Fails ----- Error: no identifier for declarator foos[0]; Works if a redundant typeof is added: typeof(foos[0].Type) x = 20;
Please remember to assign keywords to bug reports. To everybody reading this: Please look through issues you've reported and check for missing keywords.
An extra alias can be added to stop the gap: template Foo(T) { alias T Type; } template Foos(A...) { alias A Foos; } alias Foos!(Foo!(int), Foo!(char)) foos; alias foos[0] foo; foo.Type x = 20;
The typeof(foos[0].Type) x = 20; trick doesn't work for me, but aliasing the array index expr works. This is a duplicate of #3085, which means no declaration of the form a[0].t x; is possible because the parser does not accept that syntax, even when t is a type. Your alias trick bypasses that limitation, that's why it works. *** This issue has been marked as a duplicate of issue 3085 ***