www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12698] New: Overloads from multiple modules implicitly merge

https://issues.dlang.org/show_bug.cgi?id=12698

          Issue ID: 12698
           Summary: Overloads from multiple modules implicitly merge into
                    a single overloadset
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: andrej.mitrovich gmail.com

I thought the following was supposed to emit a compiler error to prevent
function hijacking:

-----
import std.algorithm;  // defines copy
import std.file;  // defines another copy (unrelated)

void main()
{
    char[] src, target;
    copy(src, target);
}
-----

No errors here, the copy from std.file is picked here. 

But I thought we're required to explicitly merge overload sets via:

-----
alias copy = std.algorithm.copy;
alias copy = std.file.copy;
-----

--
May 03 2014