www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - is this a bug? or how to work around : size of type T!(B) is not known

A demo to show the problem:


--------------------------------------------
module t;

class T (X)
{
X x;
}
--------------------------------------------


--------------------------------------------
module a;

private import b;

class A {
BT b;    // A has a field of type BT === T!(B)
}
--------------------------------------------


--------------------------------------------
module b;

private import t;
private import a;

class B : A {
}

alias T!(B) BT;   // BT is just an alias
--------------------------------------------




b.d:9: size of type T!(B) is not known
b.d:9: size of type T!(B) is not known

Is this a bug? should D's module system work in this situation?

If not, what's the D's way to make it work?  suppose in real code, class T/A/B
has to be in different source files.  (I tried to put them into one file, then
it works.)
Apr 13 2005