[Issue 4883] New: std.algorithm functions conflict with std.string fucntions
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Sep 17 15:00:34 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4883
Summary: std.algorithm functions conflict with std.string
fucntions
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: major
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: seth.a.hoenig at gmail.com
--- Comment #0 from Seth A Hoenig <seth.a.hoenig at gmail.com> 2010-09-17 15:00:00 PDT ---
Given these two minimal programs:
import std.string;
void main()
{
string str = "abc";
int i = str.count("ab");
}
and:
import std.string;
import std.algorithm;
void main()
{
string str = "abc";
int i = str.count("ab");
}
The only difference is line 2, where I import std.algorithm.
The first program compiles fine, but the second program does not compile,
spitting out the error message:
bash-3.2$ dmd -ofdummy dummy.d
/u/sah2659/dmd2/linux/bin/../../src/phobos/std/functional.d(176): Error: static
assert "Bad binary function q{a == b}. You need to use a valid D expression
using symbols a of type dchar and b of type string."
/u/sah2659/dmd2/linux/bin/../../src/phobos/std/functional.d(179):
instantiated from here: Body!(dchar,string)
/u/sah2659/dmd2/linux/bin/../../src/phobos/std/algorithm.d(3410):
instantiated from here: result!(dchar,string)
dummy.d(7): instantiated from here: count!("a == b",string,string)
A little more investigating reveals that std.algorithm.indexOf and
std.string.indexOf also conflict.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list