www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14817] New: copy("foo", "bar") std.algorithm/std.file conflict

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

          Issue ID: 14817
           Summary: copy("foo", "bar") std.algorithm/std.file conflict
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: thecybershadow gmail.com

/////////// 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

--
Jul 21 2015