[Issue 11524] New: str.strip being shadowed by std.algorithm.strip
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Nov 15 19:19:18 PST 2013
https://d.puremagic.com/issues/show_bug.cgi?id=11524
Summary: str.strip being shadowed by std.algorithm.strip
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: nobody at puremagic.com
ReportedBy: hans at fugal.net
--- Comment #0 from Hans Fugal <hans at fugal.net> 2013-11-15 19:19:10 PST ---
import std.string;
import std.stdio;
// OK
unittest {
string foo = " foo ";
writeln(foo.strip);
}
/* Not OK
strip.d(21): Error: template std.algorithm.strip does not match any function
template declaration. Candidates are:
/usr/share/dmd/src/phobos/std/algorithm.d(7122):
std.algorithm.strip(Range, E)(Range range, E element) if
(isBidirectionalRange!Range && is(typeof(range.front == element) : bool))
/usr/share/dmd/src/phobos/std/algorithm.d(7129):
std.algorithm.strip(alias pred, Range)(Range range) if
(isBidirectionalRange!Range && is(typeof(pred(range.back)) : bool))
strip.d(21): Error: template std.algorithm.strip(Range, E)(Range range, E
element) if (isBidirectionalRange!Range && is(typeof(range.front == element) :
bool)) cannot deduce template function from argument types !()(string)
*/
unittest {
import std.algorithm;
string bar = " bar ";
writeln(bar.strip);
}
/* if I move "import std.algorithm;" outside of the unittest, it works fine. */
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list