New Issue: need warnings for differences between public and private use

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:

  1. public use M no longer brings in M itself
  • M can be brought in as well with either public import M; public use M; or public use M as M
  1. public use M no longer introduces a shadow scope even though private 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 use M within your module but there is no M -> 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”