www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 494] New: template's variadic argument can't use as type

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=494

           Summary: template's variadic argument can't use as type
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: lovesyao hotmail.com


template test(TA...){
  const TA[0] test=0;
}

template test2(TA...){
  const TA[0] test2=TA[0].init;
}

typedef int dummy=0;
typedef int myint=3;

void main(){
  assert(test!(int)==0);//failed
  assert(test2!(int)==int.init);//failed
  assert(test2!(myint)==myint.init);//failed
  assert(test!(int,dummy)==0);//failed
  assert(test2!(int,dummy)==int.init);//failed
  assert(test2!(myint,dummy)==myint.init);//failed
}


-- 
Nov 11 2006
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=494


deewiant gmail.com changed:

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




------- Comment #1 from deewiant gmail.com  2006-11-15 02:56 -------
Fixed DMD 0.174.


-- 
Nov 15 2006
prev sibling parent Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

d-bugmail puremagic.com schrieb am 2006-11-12:
 http://d.puremagic.com/issues/show_bug.cgi?id=494

 template test(TA...){
   const TA[0] test=0;
 }

 template test2(TA...){
   const TA[0] test2=TA[0].init;
 }

 typedef int dummy=0;
 typedef int myint=3;

 void main(){
   assert(test!(int)==0);//failed
   assert(test2!(int)==int.init);//failed
   assert(test2!(myint)==myint.init);//failed
   assert(test!(int,dummy)==0);//failed
   assert(test2!(int,dummy)==int.init);//failed
   assert(test2!(myint,dummy)==myint.init);//failed
 }

Added to DStress as http://dstress.kuehne.cn/compile/t/tuple_07_A.d http://dstress.kuehne.cn/compile/t/tuple_07_B.d http://dstress.kuehne.cn/compile/t/tuple_07_C.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFFjY+lLK5blCcjpWoRAgFXAJ9XYvsX/+sAVbYOVg4UbBOOv71kGQCfX7fI HCjpJqQqRRIqzj/Z3c5LnKQ= =21q6 -----END PGP SIGNATURE-----
Dec 23 2006