Names and scope in D

Dibyendu Majumdar mobile at majumdar.org.uk
Sun Nov 29 18:28:02 UTC 2020


On Saturday, 28 November 2020 at 19:36:25 UTC, Paul Backus wrote:
> On Saturday, 28 November 2020 at 15:16:11 UTC, Dibyendu 
> Majumdar wrote:
>>
>> module scopes;
>>
>> int scopes;
>>
>> This is accepted by the compiler which surprised me.
>> Is this intentional?
>
> The reason these do not conflict is that they are not in the 
> same scope. `int scopes` is inside the module (FQN: 
> scopes.scopes), whereas `module scopes` *is* the module (FQN: 
> scopes).

Yes okay, that makes sense.


More information about the Digitalmars-d mailing list