Bug 8187 – replaceFirst doesn't work for string[] haystack
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-06-02T09:40:00Z
Last change time
2012-06-10T20:44:46Z
Assigned to
nobody
Creator
andrej.mitrovich
Comments
Comment #0 by andrej.mitrovich — 2012-06-02T09:40:55Z
import std.array;
void main()
{
string[] res = ["a", "a"];
string[] x = replace(res, "a", "b"); // ok
string[] y = replaceFirst(res, "a", "b"); // NG
}
Error: D:\DMD\dmd2\windows\bin\..\..\src\phobos\std\array.d(1763): Error: cannot implicitly convert expression (app.data()) of type string to string[]