www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7856] New: static import-ed module behaves as symbol it contents

http://d.puremagic.com/issues/show_bug.cgi?id=7856

           Summary: static import-ed module behaves as symbol it contents
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: malicious.wizard gmail.com



---
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));
    }

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 08 2012