[Issue 14791] New: std.string.indexOf(char[], char) no longer compiles
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Thu Jul 9 15:36:30 PDT 2015
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 at puremagic.com
Reporter: code at 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
--
More information about the Digitalmars-d-bugs
mailing list