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.
[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.
This is one of the case in issue 2803. And from 2.062, it's also blocked by regression issue 13950.
https://github.com/D-Programming-Language/dmd/pull/4261
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/37d633886a342c621ff4705428480f62cc5ab27a fix Issue 6613 - Can't use empty tuple as default value for variadic template function parameter
Commit pushed to stable at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/37d633886a342c621ff4705428480f62cc5ab27a fix Issue 6613 - Can't use empty tuple as default value for variadic template function parameter