http://d.puremagic.com/issues/show_bug.cgi?id=5666


Rainer Schuetze <r.sagita...@gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |r.sagita...@gmx.de


--- Comment #5 from Rainer Schuetze <r.sagita...@gmx.de> 2011-03-10 14:34:41 
PST ---
Very much related is this issue with join in dmd 2.052:

import std.string;

void main()
{
    string[] a = ["1","2","3"];
    join(a,std.string.newline);
}

test.d(6): Error: template std.array.join(RoR,R) if (isInputRange!(RoR) &&
isInputRange!(ElementType!(RoR)) && isForwardRange!(R)) does not match any
function template declaration
test.d(6): Error: template std.array.join(RoR,R) if (isInputRange!(RoR) &&
isInputRange!(ElementType!(RoR)) && isForwardRange!(R)) cannot deduce template
function from argument types !()(string[],immutable(char[2u]))

This worked in 2.051, aswell as the code with replace in the original report.

I consider these regressions, because the functions should just work with
immutable string arguments. The user should not be bothered with the internals
of the implementation of these functions. IIRC the regression happened because
both functions are now based on ranges in std.array, whereas there were some
special string implementations in std.string before.

The new implementations would probably work if creating a copy of a value of
type "immutable char[]" (as done when passing a function argument to
replace/join) would allow implicite conversion to immutable(char)[].

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to