Bug? package attribute half working on child packages.

Jeremie Pelletier jeremiep at gmail.com
Sun Mar 15 14:55:30 PDT 2009


I don't know if it's really a bug, but the package protection attribute seems to have a different semantic in the current packages than in nested packages.

For example, say you have the module test which declares the following:
---
module test.Foo;

package uint myVar;
package class MyClass {}

package void MyFunc();

class Foo {
    package void MyFoo();
}
---

All declarations are accessible from any module in the test package, but if you try and access them from a child package, say test.somepackage.Foo, then only myVar and MyClass are accessible, both MyFunc and Foo.MyFoo says they aren't accessible from test.somepackage.Foo.

I'm using the latest DMD version 2.



More information about the Digitalmars-d mailing list