[Issue 2725] New: Pattern matching in static if not working with variadic arguments

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 10 08:11:23 PDT 2009


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

           Summary: Pattern matching in static if not working with variadic
                    arguments
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: andrei at metalanguage.com


struct A(B...) {}

void main()
{
    alias A!(int, float) X;
    static if (!is(X Y == A!(Z), Z))
    {
        static assert(false);
    }
}

This example fails the static assert. If one removes the float in the
instantiation of A the example compiles.

The compiler should match Z to the type tuple (int, float). Otherwise it is
impossible to detect whether a type is an instantiation of a variadic template.


-- 



More information about the Digitalmars-d-bugs mailing list