Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[module.import]/3 remove redundant importing of interface partitions #4907

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

RedBeard0531
Copy link
Contributor

@RedBeard0531 RedBeard0531 commented Sep 15, 2021

https://eel.is/c++draft/module.import#7 already describes how importing a TU implicitly imports all TUs that are export imported from the TU. https://eel.is/c++draft/module.unit#3.sentence-3 ensures that all interface partitions are transitively exported by the primary interface unit. Therefore, [module.import]/3 does not need to say that it imports "all module interface units of M" (unless the implication is that it also imports interface partitions that are not transitively exported by the PMI). I think it is simpler if [module.import]/3 only describes the "root" interface TU being imported with /7 handling the transitive importing of partitions. This also matches the wording used at https://eel.is/c++draft/module.unit#8 to describe the implicit import M; that occurs after module M;.

https://eel.is/c++draft/module.import#7 already describes how importing a TU implicitly imports all TUs that are `export import`ed from the TU. https://eel.is/c++draft/module.unit#3.sentence-3 ensures that all interface partitions are transitively exported by the primary interface unit. Therefore, [module.import]/3 does not need to say that it imports "all module interface units of `M` (unless the implication is that it also imports interface partitions that are not transitively exported by the PMI). I think it is simpler if [module.import]/3 only describes the "root" interface TU being imported with /7 handling the transitive importing of partitions. This also matches the wording used at https://eel.is/c++draft/module.unit#8 to describe the implicit `import M;` that occurs after `module M;`.
@jensmaurer
Copy link
Member

@zygoloid , what's your opinion here?

@jensmaurer jensmaurer added the decision-required A decision of the editorial group (or the Project Editor) is required. label Oct 24, 2021
@zygoloid
Copy link
Member

I think what a reader of this section wants to know is that importing a module effectively imports all module interface units -- that's the intended semantic effect, and transitive re-export via export import :foo is more of a vehicle by which we get that effect. While I think it's sufficient and arguably more elegant to say that we import just the primary interface unit here, if we make this change I think we should add a note saying that as a consequence, all interface partitions are also imported.

@jensmaurer jensmaurer added changes requested Changes to the wording or approach have been requested and not yet applied. and removed decision-required A decision of the editorial group (or the Project Editor) is required. labels Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes requested Changes to the wording or approach have been requested and not yet applied.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants