Scope modules DIP rough messy draft.

12345swordy alexanderheistermann at gmail.com
Mon Oct 29 13:20:29 UTC 2018


On Monday, 29 October 2018 at 01:37:07 UTC, luckoverthere wrote:
>
> // A.d /////////////////////////////////////////////////////////
>
> module A;
>
> public import A.B; // What happens here now ?
>
> module B
> {
>    void foo();
> }

what you are doing is the equivalent of this:

module A.B;
public import A.B;


> You are calling a different function from the same module name.

If you have more then one module with the same name with 
conflicting definitions then the compiler will give you an 
ambiguity error. You can encounter that same problem without this 
Dip. Put two modules named A in the same folder with different 
functions definitions and try to call it from module B.

-Alex




More information about the Digitalmars-d mailing list