In case there is symbol in module that has the same name as module itself, it will be substituted for module when doing static import regardless of protection level. Example: === mod.d: module mod; private { version(foo) union mod {}; version(bar) struct mod {}; version(baz) class mod {}; version(quux) alias int mod; } === modmain.d: module modmain; import std.stdio; static import mod; void main() { writeln(typeid(mod)); }
With the provided example, all I get is: modmain.d(7): Error: no type for typeid(mod) even with the DMD versions released at the time this bug was filed. Please reopen if you can provide a working example.