[Issue 600] New: error occurs when using template's tuple argument with typetuple having values

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Nov 25 20:32:51 PST 2006


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

           Summary: error occurs when using template's tuple argument with
                    typetuple having values
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: lovesyao at hotmail.com


template Test(TL...) {
  static if(TL.length == 1)
    alias TL[0] Test;
  else
    alias Test!(TL[1..$]) Test;
}

static assert(is(Test!(int,long,char[],ubyte) == ubyte));//ok
static assert(Test!(1,2,3,4) == 4);//error: test.d(5): tuple TL is used as a
type
static assert(is(Test!(int,3,2,ubyte) == ubyte));//failed
static assert(Test!(1,long,char[],4) == 4);//error: test.d(2): Error: long is
not an expression
                                             //        test.d(2): Error: char[]
is not an expression


-- 




More information about the Digitalmars-d-bugs mailing list