<div dir="ltr">Just a small bug found while trying to generalize template parameter packs for C++11 support in Calypso (implementing it in DMD is more intrusive that I would like, but I can't see any simple alternative):<br><br>  <a href="https://github.com/dlang/dmd/blob/7e60772afac6401b934981df5e2b33b33487514a/src/dtemplate.d#L8120">https://github.com/dlang/dmd/blob/7e60772afac6401b934981df5e2b33b33487514a/src/dtemplate.d#L8120</a><br><br>> if (i < nparams && (*tempdecl.parameters)[i].specialization())<br>>     buf.writeByte('H'); // <a href="https://issues.dlang.org/show_bug.cgi?id=6574">https://issues.dlang.org/show_bug.cgi?id=6574</a><br><br>isn't correct when i and args get switched by:<br><br>  <a href="https://github.com/dlang/dmd/blob/7e60772afac6401b934981df5e2b33b33487514a/src/dtemplate.d#L8205">https://github.com/dlang/dmd/blob/7e60772afac6401b934981df5e2b33b33487514a/src/dtemplate.d#L8205</a><br><br>> // Tuple va = isTuple(o);<br>> else if (va)<br>> {<br>>     assert(i + 1 == args.dim); // must be last one<br>>     args = &va.objects;<br>>     i = -cast(size_t)1;<br>> }<br><br>But this begged a question: why and how do some template instances end up with Tuple in their tiargs?<br><br>The presence of Tuple doesn't seem consistent with findBestMatch which expands Tuple tdtypes into multiple tiargs:<br><br>  <a href="https://github.com/dlang/dmd/blob/7e60772afac6401b934981df5e2b33b33487514a/src/dtemplate.d#L7706">https://github.com/dlang/dmd/blob/7e60772afac6401b934981df5e2b33b33487514a/src/dtemplate.d#L7706</a><br><br>Having to deal with the two possible cases, one where Tuple get expanded, the other where they're aren't, makes adding support for multiple parameter packs much harder.<br><br>Any good reason for not wanting a Tuple-free tiargs?</div>