19780, "mppf", "need warnings for differences between public and private use", "2022-05-10T13:37:26Z"
PR #19306 introduced two differences between public use
and private use
:
-
public use M
no longer brings inM
itself
-
M
can be brought in as well with eitherpublic import M; public use M;
orpublic use M as M
-
public use M
no longer introduces a shadow scope even thoughprivate use M
does.
To help those changes be less confusing, the proposal is to add warnings for cases where the difference between public use M
and private use M
might be surprising:
-
public use M
and then you try to useM
within your module but there is noM
-> warning “public use does not bring in module name ; change to public use M as M or add import M” -
public use M; private use N;
where both define the same symbol X -> warning “public use does not use shadow scopes, so X here refers to M.X. Please adjust the use statements to include an ‘except’ to indicate whether you want M.X or N.X”