Package visibility strange behaviour

Oleg B via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Feb 27 06:07:21 PST 2017


Hello. Is this behavior normal, or it's a bug? And if it's normal 
why it's normal? I want to use function with `package` visibility 
in same package where it's defined, but I don't.

```d
module package_visible;
package void foo() { }
void main() { foo(); }
```

```
% rdmd package_visible.d
package_visible.d(3): Error: function package_visible.foo is not 
accessible from module package_visible
Failed: ["dmd", "-v", "-o-", "package_visible.d", "-I."]
```

dmd version v2.073.1


More information about the Digitalmars-d-learn mailing list