20707, "mppf", "Should a transitive use ever allow access to a private symbol", "2022-09-23T17:12:51Z"
Should the below program compile? If it does, public use M;
in module Other
must be bringing in private symbols (and then whether the private symbols can be used or not is decided later). But it would seem more intuitive for that use statement not to bring in private symbols because Other
does not have access to them.
module M {
private var x: int;
private proc f() {
writeln("in f");
}
module Sub {
use Other;
proc inner() {
writeln("x is ", x);
f();
}
}
proc main() {
use Sub;
inner();
}
}
module Other {
public use M;
}