What    |Removed                     |Added
           Severity|major                       |critical
           Keywords|                            |diagnostic
            Version|2.017                       |2.023

------- Comment #2 from  2009-01-25 22:11 -------
Upgrading to critical and incrementing version because this bug still exists,
I've been bitten by this several times now, and each time it's quite confusing.
 Also, the following example actually does give a proper error message, because
instantiation of std.algorithm.find succeeds, and then DMD realizes that it
conflicts with std.string.find:

import std.algorithm, std.string;

void main() {
    auto i = find("foobar", 'f');

The root of the problem, then, is that DMD tries to instantiate any template
functions that match the name of the function being called before outputting a
name conflict error message.  If the instantiation of these templates fails,
then DMD fails with error messages related to its attempt at instantiating the
template, rather than either silently using the non-template function (probably
a bad idea) or failing with a name conflict error message (the right thing). 
Instead, DMD should fail *before* trying to instantiate the template function
whose name conflicts with the non-template function, if they are not in the
same overload set.


Reply via email to