www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Bug in imports

I have a rather complex setup of interfaces inheriting from each 
other in multiple modules.

Everything was working fine until I added a new interface and 
included it at the end of a public imports list:


...
<about 20 module imports>
...
public import newModule;

newModule contains an interface which I use with other interfaces 
in other modules.

After doing this I end up with a lot of forward reference errors.

I put the import at the front and everything worked fine. e.g.,

public import newModule;
...
<about 20 module imports>
...


Luckily newModule does not depend on any previous modules else I 
imagine I would end up with a circular reference that would be 
impossible to fix easily.


---------------
module A;
import modules;

interface iA : iB { ... }
interface iAA { ... }
----------




---------------
module B;
import modules;

interface iB : iAA { ... }
----------



---------------
module modules;
public import A;
public import B;

/* or

public import B;
public import A;
*/
----------


I don't have time to try this out but this is what seems to be 
going on in my program(just renamed and shorted everything).
Dec 26 2013