Comment #0 by dlang-bugzilla — 2011-09-06T12:40:19Z
template Tuple(T...) { alias T Tuple; }
void f(T...)(int arg0 = 0, T argN = Tuple!());
static this() { f(); }
Compiler output:
test.d(3): Error: cannot implicitly convert expression (tuple()) of type () to ()
test.d(5): Error: template instance test.f!() error instantiating
The compiler requires a default value for argN, because it comes after another optional argument, but it doesn't seem like an empty tuple can be specified.
Comment #1 by andrej.mitrovich — 2013-02-08T18:01:40Z
[internal note]: It seems Tuple!() is treated as a type when it's a default argument (at least ExpInitializer::semantic seems to think so). But as a variable initializer it works ok:
template Tuple(T...) { alias T Tuple; }
void main()
{
Tuple!() t = Tuple!();
}
CC'ing Kenji since he might be interested in this bug.
Comment #2 by k.hara.pg — 2015-01-08T03:49:12Z
This is one of the case in issue 2803.
And from 2.062, it's also blocked by regression issue 13950.