Bug in imports

Frustrated c1514843 at drdrb.com
Thu Dec 26 15:43:40 PST 2013


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).



More information about the Digitalmars-d-learn mailing list