[Issue 14271] New: DMD 2.067-b4: strange behaviour of new package syntax

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Mar 10 12:55:27 PDT 2015


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

          Issue ID: 14271
           Summary: DMD 2.067-b4: strange behaviour of new package syntax
           Product: D
           Version: D2
          Hardware: x86_64
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: rswhite4 at gmail.com

Code:
----
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 to bar works, but the call to foo returns the following error message:
Error: struct A.B.Foo.Foo member foo is not accessible

--


More information about the Digitalmars-d-bugs mailing list