[Issue 12698] New: Overloads from multiple modules implicitly merge into a single overloadset
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sat May 3 13:56:41 PDT 2014
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 at puremagic.com
Reporter: andrej.mitrovich at 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;
-----
--
More information about the Digitalmars-d-bugs
mailing list