www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Bug 76] New: Using a non-template struct as a template

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

           Summary: Using a non-template struct as a template
           Product: D
           Version: 0.148
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: nail-mail mail.ru


struct S
{
        template T()
        {
                void x(int i)
                {                       
                }
        }
}

class C(P)
{
        mixin P!().T!();
}

int main(char[][] args)
{
        auto c = new C!(S);

        return 0;
}

Compiling leads to "Assertion failure: 's->parent' on line 1694 in file
'template.c'"


-- 
Mar 28 2006
parent Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

d-bugmail puremagic.com schrieb am 2006-03-28:
 struct S
 {
         template T()
         {
                 void x(int i)
                 {                       
                 }
         }
 }

 class C(P)
 {
         mixin P!().T!();
 }

 int main(char[][] args)
 {
         auto c = new C!(S);

         return 0;
 }

 Compiling leads to "Assertion failure: 's->parent' on line 1694 in file
 'template.c'"

Added to DStress as http://dstress.kuehne.cn/nocompile/m/mixin_18_A.d http://dstress.kuehne.cn/nocompile/m/mixin_18_B.d http://dstress.kuehne.cn/nocompile/m/mixin_18_C.d http://dstress.kuehne.cn/nocompile/m/mixin_18_D.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFELu0q3w+/yD4P9tIRAlMgAKDGjA6flJ8bP9o1FR9SDowppwVKhQCfc/7I AZW9ugRFY8bBzvLRaHeZs8s= =uAR/ -----END PGP SIGNATURE-----
Apr 01 2006