[Issue 13709] New: Can access symbols that are not publicly imported via full name

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Nov 10 22:38:37 PST 2014


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 at puremagic.com
          Reporter: maximzms at 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
}
-----------------

--


More information about the Digitalmars-d-bugs mailing list