See code below. rdmd main.d fails with 'Error 42 Undefined Symbol'. Unexpectedly,removing the comment around import B in main removes issue at cost of widening scope. // main void main() { import A; // import B; import std.stdio; writeln("Entered main"); fnA1(); writeln("Leaving main"); } module A; void fnA1() { import B; import std.stdio; writeln("Entered fnA1"); fnB1(); writeln("Leaving fnA1"); } module B; void fnB1() { import std.stdio; writeln("Entered fnB1"); writeln("Leaving fnB1"); }