Mercury Bugs - mercury
View Issue Details
0000555mercuryFeature Requestpublic2022-04-05 12:122022-04-05 12:12
Reporterwangp 
Assigned To 
PrioritynormalSeverityminorReproducibilityN/A
StatusnewResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000555: do not implicitly import modules imported by ancestor modules
DescriptionWe may want to change the submodule visibility rule so that declarations from modules imported by ancestor modules are NOT automatically visible to a submodule.

E.g.
Module a declares foo, and happens to import io.
Module a.b can see foo, but it must import io itself if it wants to use io.

This change would reduce unwanted coupling between the parent module and submodule (as described in commit 92438b2ec). It would also allow the compiler to warn about unnecessary imports that currently *might* be required by a submodule.

An argument against this change is that since nested submodules are written in the same source file as the parent module, it does seem somewhat natural (in a "block scoping" way) for imports in the parent module to also affect a nested submodule. We would not want to have different visibility rules for nested or separate submodules.

May be related to Mantis bug 0000505
TagsNo tags attached.
Attached Files

There are no notes attached to this issue.

Issue History
2022-04-05 12:12wangpNew Issue