Names and scope in D

Dibyendu Majumdar d.majumdar at gmail.com
Sat Nov 14 17:06:49 UTC 2020


In this example:

module scopes;

int foo;
struct foo {
     int a;
}

void foo() {
     foo foo;
     foo.a = 5;
}


I see that the compiler complains about conflict in the use of 
foo.

I couldn't find the rules that D uses to decide whether a name 
conflicts or not. If I missed something please can someone point 
me to it?




More information about the Digitalmars-d mailing list