www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13709] New: Can access symbols that are not publicly imported

https://issues.dlang.org/show_bug.cgi?id=13709

          Issue ID: 13709
           Summary: Can access symbols that are not publicly imported via
                    full name
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: maximzms gmail.com

DMD version: 2.066.1

In the example below `main.d` can't call functions from `std.stdio` since the
import in `foo.d` is not public.
However there is access to the functions by full name (e.g. `std.stdio.write`).

----- foo.d -----
module foo;
import std.stdio; // There is no public import
-----------------

----- main.d ----
import foo;
void main()
{
    // write("hello"); // <--- Error
    std.stdio.write("hello"); // <--- Works
}
-----------------

--
Nov 10 2014