[Issue 314] New: Static, renamed, and selective imports are always public

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Aug 27 07:42:49 PDT 2006


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

           Summary: Static, renamed, and selective imports are always public
           Product: D
           Version: 0.165
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: accepts-invalid
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: deewiant at gmail.com
 BugsThisDependsOn: 313


In file a.d:
--
// explicit privates unnecessary but added for clarity
version(stat) private static import std.stdio;
version(rena) private import io = std.stdio;
version(sele) private import std.stdio : writefln;
--
In file b.d:
--
import a;

void main() {
        version(stat) std.stdio.writefln("This should not work.");
        version(rena) io.writefln("This should not work.");
        version(sele) writefln("This should not work.");
}
--

Compiled with version=stat, version=rena, or version=sele, the program outputs
"This should not work.", when it shouldn't even compile.

Note that the version(stat) case is dependant on Issue 313.


-- 




More information about the Digitalmars-d-bugs mailing list