www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Template error?

reply "Kris" <fu bar.com> writes:
The following fails to compile:

struct Foo
{
        struct Bar(T)
        {
                static void bar() {}
        }
}

void main()
{
        Foo.Bar!(char).bar();
}

If Foo is a class, then it compiles fine. 
Dec 05 2005
parent Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Kris schrieb am 2005-12-05:
 The following fails to compile:

 struct Foo
 {
         struct Bar(T)
         {
                 static void bar() {}
         }
 }

 void main()
 {
         Foo.Bar!(char).bar();
 }

 If Foo is a class, then it compiles fine. 
Added to DStress as http://dstress.kuehne.cn/run/s/static_35_A.d http://dstress.kuehne.cn/run/s/static_35_B.d http://dstress.kuehne.cn/run/s/static_35_C.d http://dstress.kuehne.cn/run/s/static_35_D.d http://dstress.kuehne.cn/run/s/static_35_E.d http://dstress.kuehne.cn/run/s/static_35_F.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFDmsxO3w+/yD4P9tIRArMIAJ4v4X0aii7mguP0hY+aL5x+KTrUjQCZAXGS Q1euLDvVW1uMkxjgsccmcVg= =/ahe -----END PGP SIGNATURE-----
Dec 10 2005