www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19144] New: Imported package have different protection

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

          Issue ID: 19144
           Summary: Imported package have different protection depending
                    on how it's accessed
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: b2.temp gmx.com

file1.d ---
import std.stdio;

file2.d ---
import file1;
pragma(msg, __traits(getProtection, __traits(getMember, file1, "std")));
pragma(msg, __traits(getProtection, file1.std));
static assert( __traits(isSame, __traits(getMember, file1, "std"), file1.std));


output:
  public
  private

instead of
  private
  private

Bug seems to happen only for packages.

--
Aug 06 2018