I have these two minimal programs:<br><br><br>import std.string;<br>void main()<br>{<br>    string str = &quot;abc&quot;;<br>    int i = str.count(&quot;ab&quot;);<br>    <br>}<br><br><br><br>and:<br><br><br><br>import std.string;<br>
import std.algorithm;<br>void main()<br>{<br>    string str = &quot;abc&quot;;<br>    int i = str.count(&quot;ab&quot;);<br>    <br>}<br><br><br><br>The only difference is line 2, where I import std.algorithm. <br>The first program compiles fine, but the second program does not compile, spitting out the error message:<br>
<br>bash-3.2$ dmd -ofdummy dummy.d<br>/u/sah2659/dmd2/linux/bin/../../src/phobos/std/functional.d(176): Error: static assert  &quot;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.&quot;<br>
/u/sah2659/dmd2/linux/bin/../../src/phobos/std/functional.d(179):        instantiated from here: Body!(dchar,string)<br>/u/sah2659/dmd2/linux/bin/../../src/phobos/std/algorithm.d(3410):        instantiated from here: result!(dchar,string)<br>
dummy.d(7):        instantiated from here: count!(&quot;a == b&quot;,string,string)<br><br><br>I can&#39;t imagine I&#39;m the first person to notice a bug like this, so is there something I am doing wrong?<br>