[Chapel Merge] Only list named modules (not named enums) in `modulesNamedInUseOrImport`

Branch: refs/heads/main
Revision: c4b3210c12fa39364696a47f839046b6e9c5f1e1
Author: DanilaFe
Link: Only list named modules (not named enums) in `modulesNamedInUseOrImport` by DanilaFe · Pull Request #25626 · chapel-lang/chapel · GitHub
Log Message:
Only list named modules (not named enums) in modulesNamedInUseOrImport (#25626)

Closes [Documentation]: `chpldoc` errors out for `use`ed enums with `--process-used-modules` · Issue #25620 · chapel-lang/chapel · GitHub.

Despite its name, the modulesNamedInUseOrImport function sometimes
allows enums in (if they are used or imported). Since this is
occasionally -- but not always -- guarded against in existing code, I
assume that the intention was to keep the function true to its name, and
to always exclude non-modules. So, I've generalized the check to cover
all cases.

Reviewed by @ShreyasKhandekar and @dlongnecke-cray -- thanks!

Testing

  • dyno tests, including new test for modulesNamedInUseOrImport w/
    enums.

Compare: Comparing 10cce9a22ba41eb4c5b46df9b4beead373c7c579...bc1cfad435a789a2baf6c014e035bde431abe7d3 · chapel-lang/chapel · GitHub

Diff:
M frontend/lib/resolution/scope-queries.cpp
M frontend/test/resolution/testModuleInitOrder.cpp
https://github.com/chapel-lang/chapel/pull/25626.diff