www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - New package behaviour in 2.067

reply "Namespace" <rswhite4 gmail.com> writes:
I'm unsure, but I think this code should work:

----
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

Is this intended?
Mar 10 2015
next sibling parent ketmar <ketmar ketmar.no-ip.org> writes:
On Tue, 10 Mar 2015 23:17:01 +0000, Namespace wrote:

 Is this intended?
i doubt so. `struct Foo` is definitely `public`, so there shouldn't be=20 any problems with access rights.=
Mar 10 2015
prev sibling parent reply "Dicebot" <public dicebot.lv> writes:
Looks like bug, investigating.
Mar 10 2015
parent "Dicebot" <public dicebot.lv> writes:
https://issues.dlang.org/show_bug.cgi?id=14275
Mar 10 2015