On 04/29/2014 01:34 PM, Simen Kjærås via Digitalmars-d wrote:

Building on this knowledge:

module foo;

void func();


module bar;

extern(C++, foo) void func();


module prog;

import foo;
import bar;

void main()
{
     // Seems like it's ambiguous between foo.func and bar.foo.func.
     foo.func();
}

It will call foo.func, because the module foo is in scope in module prog and hence hides the namespace foo in module bar.

You can already try this today, as the DIP _does not actually introduce any new lookup rules_:

module a;
void func(){}
//---
module bar;

mixin template X(){
    void func();
}
mixin X foo;
//---
import foo,bar;

void main(){
    foo.func();
}

In particular, any problems you find with symbol lookup are actually orthogonal to the DIP.

Reply via email to