Bug 7856 – static import-ed module behaves as symbol it contents

Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Mac OS X
Creation time
2012-04-08T04:16:00Z
Last change time
2017-06-26T00:52:43Z
Assigned to
nobody
Creator
malicious.wizard

Comments

Comment #0 by malicious.wizard — 2012-04-08T04:16:55Z
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)); }
Comment #1 by dlang-bugzilla — 2017-06-26T00:52:43Z
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.