www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2422] New: Type is turned into type tuple in variadic template

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 digitalmars.com
        ReportedBy: samukha 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[]


-- 
Oct 19 2008