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?