cat > a.d << EOF module a; void bar() { import b : foo; foo(); } EOF cat > b.d << EOF module b; void foo() { } EOF dmd -c a.d ---- Selective imports in local function scope are not visible. Reference: https://github.com/D-Programming-Language/d-programming-language.org/blob/59fd17365e9544d285bdb0b3c321ea1d6808218c/module.dd#L366
*** This issue has been marked as a duplicate of issue 7494 ***