Is entity (aka symbol?) name shadowing valid or not in D?
In statement.html the spec says:
"A block statement introduces a new scope for local symbols. A local
symbol's name, however, must be unique within the function.
...
void func2(){
int x;
{
int x; // illegal, x is multiply defined in function scope
}
}
"
However that same code segment compiles quite ok. Also, in mixin.html,
the first example uses name shadowing to illustrate the use of mixins.
--
Bruno Medeiros - CS/E student
"Certain aspects of D are a pathway to many abilities some consider to
be... unnatural."

Is entity (aka symbol?) name shadowing valid or not in D?
In statement.html the spec says:
"A block statement introduces a new scope for local symbols. A local
symbol's name, however, must be unique within the function.
...
void func2(){
int x;
{
int x; // illegal, x is multiply defined in function scope
}
}
"
However that same code segment compiles quite ok.

-> digitalmars.D.bugs

Also, in mixin.html,
the first example uses name shadowing to illustrate the use of mixins.

Is entity (aka symbol?) name shadowing valid or not in D?
In statement.html the spec says:
"A block statement introduces a new scope for local symbols. A local
symbol's name, however, must be unique within the function.
...
void func2(){
int x;
{
int x; // illegal, x is multiply defined in function scope
}
}
"
However that same code segment compiles quite ok.

-> digitalmars.D.bugs

Also, in mixin.html, the first example uses name shadowing to
illustrate the use of mixins.

Yes, if mixins are an exception to this rule, then it should be documented.
Stewart.

about it.
--
Bruno Medeiros - CS/E student
"Certain aspects of D are a pathway to many abilities some consider to
be... unnatural."