[Issue 2422] New: Type is turned into type tuple in variadic template

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Oct 19 06:08:42 PDT 2008


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

           Summary: Type is turned into type tuple in variadic template
           Product: D
           Version: 2.019
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: samukha at voliacable.com


template Bar(A...)
{
    alias A[0] T;
    T[] a = [];
}

template Foo(A...)
{
    alias Bar!(A) bar;
}

alias Foo!(int, 1) foo;
----
Error: can't have array of (int)

T in Bar becomes tuple(int) instead of expected int. The example compiles if
all arguments passed to Foo are types:

alias Foo!(byte, int) foo; // ok, foo.a is byte[]


-- 



More information about the Digitalmars-d-bugs mailing list