[Issue 6180] New: Private has no effect on types in modules

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jun 19 17:40:50 PDT 2011


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

           Summary: Private has no effect on types in modules
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: accepts-invalid
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: andrej.mitrovich at gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2011-06-19 17:36:05 PDT ---
Example:

foo.d:
module foo;

private
{
    int x;
    class Foo {}
}

main.d:
module main;

import foo;

void main() 
{
    // x = 5; // Error: module main foo.x is private
    auto foo = new Foo();  // accepted!!
}

Currently I have a problem with clashing symbols between
std.concurrency.MessageBox which is a private class and the Windows bindings
win32.winuser.MessageBox, which is a public function. It's a very commonly used
function btw. My workaround is this after the last import:

alias win32.winuser.MessageBox MessageBox;

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


More information about the Digitalmars-d-bugs mailing list