www.digitalmars.com         C & C++   DMDScript  

D - Bug: Template class inheriting from another template class.

reply Andy Friesen <andy ikagames.com> writes:
Given:

     class C() {
         void foo() {
             printf("C ");
         }
     }

     class E(T) : C!() {
         void foo()
         {
             printf("E ");
             super.foo();
         }
     }

     alias E!(int) Eint;

     void main() {
         Eint eint = new Eint();
         eint.foo();
     }

The compiler spits out:

     test2.d(23): Eint is used as a type


  -- andy
Jan 25 2004
parent reply J Anderson <REMOVEanderson badmama.com.au> writes:
Andy Friesen wrote:

 Given:

     class C() {
         void foo() {
             printf("C ");
         }
     }

     class E(T) : C!() {
         void foo()
         {
             printf("E ");
             super.foo();
         }
     }

     alias E!(int) Eint;

     void main() {
         Eint eint = new Eint();
         eint.foo();
     }

 The compiler spits out:

     test2.d(23): Eint is used as a type


  -- andy

Humm, works for me. -- -Anderson: http://badmama.com.au/~anderson/
Jan 26 2004
parent Andy Friesen <andy ikagames.com> writes:
J Anderson wrote:
 
 Humm, works for me.
 

doh. It works in 0.79. -- andy
Jan 26 2004