www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5126] New: is expression: matched variadic arguments get empty

reply d-bugmail puremagic.com writes:
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: nobody puremagic.com
        ReportedBy: rsinfu gmail.com


--- Comment #0 from Shin Fujishiro <rsinfu 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: -------
Oct 27 2010
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5126


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #1 from Kenji Hara <k.hara.pg gmail.com> 2012-06-29 23:33:31 PDT ---
Works in 2.060head.

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