<div><font face="arial, helvetica, sans-serif">Greetings</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">When I compile the code below, I unexpectedly get an error:</font></div>
<div><font face="arial, helvetica, sans-serif"><div>test.d(7): Error: template std.string.format does not match any function template declaration. Candidates are:</div><div>/home/puneet/local/github-d/bin/../phobos/std/string.d(2528): std.string.format(Char, Args...)(in Char[] fmt, Args args)</div>
<div>test.d(7): Error: template std.string.format(Char, Args...)(in Char[] fmt, Args args) cannot deduce template function from argument types !()(string,void)</div><div><br></div><div>There are a couple of issues involved here.</div>
<div>1. std.string is exposing "count" (and some other functions) from std.algorithm. I think this should be a bug since count is not listed as a method in the std.string documentation.</div><div>2. Now the function from std.algorithm that becomes visible, shadows the local argument count. Is this expected behavior? If not, has it already been reported as a bug? At the minimum I expect better error message here.</div>
<div><br></div><div>Thanks and Regards</div><div>- Puneet</div><div><br></div></font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">void main() { // 1</font></div>
<div><font face="courier new, monospace"> foo(4); // 2</font></div><div><font face="courier new, monospace">} // 3</font></div><div><font face="courier new, monospace"> // 4</font></div>
<div><font face="courier new, monospace">void foo(int count) { // 5</font></div><div><font face="courier new, monospace"> import std.string; // 6</font></div><div><font face="courier new, monospace"> format("%s", count); // 7</font></div>
<div><font face="courier new, monospace">} // 8</font></div><div><br></div>