www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14836] New: Multiple variadic template argument trick broken

https://issues.dlang.org/show_bug.cgi?id=14836

          Issue ID: 14836
           Summary: Multiple variadic template argument trick broken in
                    2.068.0-b2
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Keywords: industry
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: briancschott gmail.com

There is a trick that allows multiple variadic template arguments in a function
if the second variadic template argument list is derived only from the function
arguments. This trick worked in versions prior to the 2.068.0 betas, but it
does not work with them. Exmaple code:

---
import std.stdio : writeln;

template alpha(alias Beta, Charlie...)
{
    void alpha(Delta...)() if (Delta.length == 0)
    {
        writeln("First");
    }

    void alpha(Delta...)(Delta delta) if (Delta.length > 0)
    {
        writeln("Second");
    }
}

void main(string[] args)
{
    int a;
    alpha!(a)();
}

/*
digger: Commit 396da76e77d8dce16895291d0d39a05009d7c0bb (2/2) is untestable.
digger: There are only untestable commits left to bisect.
digger: The first bad commit could be any of:
digger: 396da76e77d8dce16895291d0d39a05009d7c0bb
digger: e5dcde500b44b5c19c6af76d6c4f67fe4102d7b5
digger: b6ffe33aa07c46953f1f14c290c47863608
*/
---

--
Jul 26 2015