On 09/23/2014 09:01 PM, Peter Alexander wrote:
On Tuesday, 23 September 2014 at 18:52:13 UTC, H. S. Teoh via
Digitalmars-d wrote:
1) Change lookup rules so that symbols pulled in by local import are
found last. Walter has stated that he disagrees with this approach
because it complicates symbol lookup rules.
This.
Agreed, but only if this is implemented such that more deeply nested
imports do not shadow less deeply nested imports.
I.e. if modules 'a' and 'b' both declare variables 'foo', then:
import a;
int fun(int foo){
import b; // fine
return foo; // fine, refers to parameter
}
auto gun(){
import b;
return foo; // error, could be a.foo or b.foo
}