http://d.puremagic.com/issues/show_bug.cgi?id=5126

           Summary: is expression: matched variadic arguments get empty
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: wrong-code
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: rsi...@gmail.com


--- Comment #0 from Shin Fujishiro <rsi...@gmail.com> 2010-10-27 14:53:08 PDT 
---
Pattern matching against template variadic arguments was fixed in bug 2725 and
now works, but there's still a problem.  The matched arguments don't get
correctly aliased:
--------------------
struct Test(T...) {}

void main()
{
    alias Test!(int, double, string) Test1;

    static if (is(Test1 _ : Test!U, U...))
    {
        static assert(U.length == 3, U.stringof);   // (9)
    }
}
--------------------
% dmd -o- -c test.d
test.d(9): Error: static assert  "()"c
--------------------

It works fine if U is not variadic:
--------------------
struct Test(int n) {}

void main()
{
    alias Test!100 Test1;

    static if (is(Test1 _ : Test!n, int n))
    {
        static assert(n == 100);    // fine
    }
    else static assert(0);
}
--------------------

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to