www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - assertion failure in template.c

reply Sean Kelly <sean f4.ca> writes:
C:\code\d\bugs>type 145_1.d
void main()
{
     auto t = new MakeTuple!(int,int)();
}

struct Empty
{

}

class Tuple( HeadType, TailType )
{

}

template MakeTuple( T1, T2 )
{
     alias Tuple!( T1, Tuple!( T2 ) ) MakeTuple;
}

template MakeTuple(T1=Empty, T2=Empty, T3=Empty)
{
     static if( is( T1 == Empty ) )
         alias Empty MakeTuple;
     else
         alias Tuple!(T1,MakeTuple!(T2,T3)) MakeTuple;
  }

C:\code\d\bugs>dmd 145_1.d
Assertion failure: 'dim == parameters->dim' on line 260 in file 'template.c'

abnormal program termination

C:\code\d\bugs>
Feb 09 2006
parent Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sean Kelly schrieb am 2006-02-10:
 C:\code\d\bugs>type 145_1.d
 void main()
 {
      auto t = new MakeTuple!(int,int)();
 }

 struct Empty
 {

 }

 class Tuple( HeadType, TailType )
 {

 }

 template MakeTuple( T1, T2 )
 {
      alias Tuple!( T1, Tuple!( T2 ) ) MakeTuple;
 }

 template MakeTuple(T1=Empty, T2=Empty, T3=Empty)
 {
      static if( is( T1 == Empty ) )
          alias Empty MakeTuple;
      else
          alias Tuple!(T1,MakeTuple!(T2,T3)) MakeTuple;
   }

 C:\code\d\bugs>dmd 145_1.d
 Assertion failure: 'dim == parameters->dim' on line 260 in file 'template.c'

 abnormal program termination

 C:\code\d\bugs>

Added to DStress as http://dstress.kuehne.cn/run/t/template_28_A.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFD7bP33w+/yD4P9tIRAnK+AJ9BM+85ksZ7J5U6IrvZx1lz8v081gCeIhDY xgNajGfcyNuhH4cWYYyx79A= =iVTe -----END PGP SIGNATURE-----
Feb 11 2006