Skip to content

Commit

Permalink
Fix modules primer for public use not bringing in mod name
Browse files Browse the repository at this point in the history
This is a belated follow-up to PR chapel-lang#19306. It is a bug that the
production compiler allows this pattern today.

---
Signed-off-by: Michael Ferguson <[email protected]>
  • Loading branch information
mppf committed Feb 23, 2023
1 parent ddb13d8 commit e285915
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/release/examples/primers/modules.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -802,8 +802,10 @@ module UsesTheUser {
}

/* By contrast, a ``public use`` will permit symbols used by one module to
be seen by those that use it. For example, consider the following
variation of the previous example:
be seen by those that use it. However, it does not provide the name
of the module ``public use``'d (but note that it is possible to opt in to
that with ``public import`` or with renaming the module with ``as``).
For example, consider the following variation of the previous example:
*/
module UserModule2 {
public use ModuleThatIsUsed;
Expand Down Expand Up @@ -838,7 +840,7 @@ module UsesTheUser2 {
module UsesTheUser3 {
proc func3() {
use UserModule2;
UserModule2.ModuleThatIsUsed.publiclyAvailableProc();
UserModule2.publiclyAvailableProc();
// The above is available due to the ``public use`` of ``ModuleThatIsUsed``
// in ``UserModule2``.
}
Expand Down

0 comments on commit e285915

Please sign in to comment.