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

--- Comment #2 from Kenji Hara <[email protected]> ---
(In reply to Andrej Mitrovic from comment #0)
> 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. 

Why do you think this is an issue? std.algorithm.copy does not match to
(char[], char[]) arguments, so std.file.copy is always chosen.

It follows the cross-module overload set resolution rule.

--

Reply via email to