www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14791] New: std.string.indexOf(char[], char) no longer compiles

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

          Issue ID: 14791
           Summary: std.string.indexOf(char[], char) no longer compiles
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: code dawg.eu

cat > bug.d << CODE
import std.string;

ptrdiff_t test()
{
    char[64] buf;
    return buf[].indexOf('\0');
}
CODE

----

dmd -c bug

----

bug2.d(6): Error: template std.string.indexOf cannot deduce function from
argument types !()(char[], char), candidates are:
/usr/include/dmd/phobos/std/string.d(346):       
std.string.indexOf(Range)(Range s, in dchar c, in CaseSensitive cs =
CaseSensitive.yes) if (isInputRange!Range &&
isSomeChar!(ElementEncodingType!Range))
/usr/include/dmd/phobos/std/string.d(471):        std.string.indexOf(T, ulong
n)(ref T[n] s, in dchar c, in CaseSensitive cs = CaseSensitive.yes) if
(isSomeChar!T)
/usr/include/dmd/phobos/std/string.d(544):       
std.string.indexOf(Range)(Range s, in dchar c, in size_t startIdx, in
CaseSensitive cs = CaseSensitive.yes) if (isInputRange!Range &&
isSomeChar!(ElementEncodingType!Range))
/usr/include/dmd/phobos/std/string.d(640):        std.string.indexOf(Range,
Char)(Range s, const(Char)[] sub, in CaseSensitive cs = CaseSensitive.yes) if
(isForwardRange!Range && isSomeChar!(ElementEncodingType!Range) &&
isSomeChar!Char)
/usr/include/dmd/phobos/std/string.d(793):        std.string.indexOf(Char1,
Char2)(const(Char1)[] s, const(Char2)[] sub, in size_t startIdx, in
CaseSensitive cs = CaseSensitive.yes) if (isSomeChar!Char1 && isSomeChar!Char2)

----

Might be related to issue 14765.
Breaks vibe.d

--
Jul 09 2015