Summary: Ambiguous renamed import is allowed
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Maxim Fomin <> 2012-08-20 03:32:46 PDT 
Currently dmd accepts renamed import with local name,
which hijacks current module name and creates ambiguity.

in foo2.d:

module foo2;
import std.stdio;

void bar()

in foo1.d:

module foo1;
import foo1 = foo2; //#1 hijack 
import std.stdio;

void bar()

int x;

void main()
{; // #2 ambiguous call is accepted
    writeln(foo1.x); // #3, Error: undefined identifier 'x'

I think either #1 should be prohibited or #2 result in 
"ambiguous call" error. Also, #3 should compile, because
x is defined in foo1.d

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to