Comment #0 by dlang-bugzilla — 2015-07-21T12:29:42Z
/////////// test.d ///////////
import std.algorithm;
import std.file;
void main()
{
copy("test.d", "test2.d");
}
//////////////////////////////
C:\...\std\algorithm\mutation.d(315): Error: cannot modify immutable expression target[idx]
C:\...\std\algorithm\mutation.d(323): Error: slice target[0..slen] is not mutable
test.d(6): Error: template instance std.algorithm.mutation.copy!(string, string) error instantiating
test.d(6): Error: std.file.copy!(string, string).copy at C:\...\std\file.d(2781) conflicts with std.algorithm.mutation.copy!(string, string).copy at C:\...\std\algorithm\mutation.d(297)
This is a regression because previously the invariant of std.algorithm.mutation.copy apparently did not accept (immutable) strings as a target.
This broke building Digger (along with issue 14765).
Introduced in https://github.com/D-Programming-Language/phobos/pull/2799
Comment #1 by peter.alexander.au — 2015-07-21T14:43:26Z
I see, I'll fix this as soon as I can.
I'm not understanding something though: I thought anti-hijacking rules were supposed to stop symbols from one module overloading with symbols from another? Shouldn't these two symbols be in conflict *regardless* of whether or not std.algorithm.mutation.copy had the template constraint?
Comment #2 by dlang-bugzilla — 2015-07-21T14:47:58Z
As I understand template constraints allow excluding functions from overload resolution if the constraints do not pass.
Comment #3 by peter.alexander.au — 2015-07-22T00:19:02Z