DIP61: redone to do extern(C++,N) syntax

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Tue Apr 29 12:52:01 PDT 2014


On 4/29/2014 9:13 AM, Steven Schveighoffer wrote:
> But what happens when you add another import that conflicts?
>
> module foo;
>
> void func() {}
>
> module prog; // updated
> import bar;
> import foo;
>
> void main(){
>     foo.func(); // now calls foo.func, and not bar.func as it originally did,
> right?
> }
>
> So by importing from another module, we have silently and drastically changed
> the behavior. Have I missed something?
>
> Why is this not a problem?

Because the compiler would now issue an error for that, it's its anti-hijacking 
feature.

Try it and see!



More information about the Digitalmars-d mailing list