20333, "e-kayrakli", "'use'ing private inner modules with fully qualified name is allowed", "2022-07-29T19:31:27Z"
module Outer {
private module Inner {
var x = 10;
}
private const foo = 20;
private proc bar() { writeln("bar"); }
}
proc main() {
use Outer;
// regardless of whether you use `Inner` in `Outer` or not, I can't do `use
// Inner` here, which is good. But qualified `use` is allowed wrongly.
use Outer.Inner;
writeln(x);
/* sanity checks: (all looks good) */
// writeln(foo); // 'foo' undeclared
// writeln(Outer.foo); // Cannot access 'foo', 'foo' is private to 'Outer'
// bar(); // unresolved call 'bar'
// Outer.bar(); // Cannot access 'foo', 'foo' is private to 'Outer'
}
This code compiles and runs, but I expect an error for use Outer.Inner
. Most likely one that says Cannot access 'Inner', 'Inner' is private to 'Outer'
.