[Issue 14275] New: Qualified package protection for aggregate member doesn't work

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Mar 10 18:05:14 PDT 2015


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

          Issue ID: 14275
           Summary: Qualified package protection for aggregate member
                    doesn't work
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: public at dicebot.lv

>From http://forum.dlang.org/post/wvfytekpmzeegeuvndqv@forum.dlang.org

----
module A.B.Foo;

import core.stdc.stdio : printf;

struct Foo {
   package(A) void foo() {
       printf("Hallo\n");
   }
}

package(A) void bar() {
   printf("Hallo\n");
}
----

and

----
module A.C.Bar;

import A.B.Foo;

void main() {
   Foo f;
   f.foo();
   bar();
}
----

The call of bar() works, but f.foo() triggers the error:
Error: struct A.B.Foo.Foo member foo is not accessible

--


More information about the Digitalmars-d-bugs mailing list