[Issue 2268] New: Compiler should generate function name conflict	error with templated functions.
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Wed Aug  6 10:26:23 PDT 2008
    
    
  
http://d.puremagic.com/issues/show_bug.cgi?id=2268
           Summary: Compiler should generate function name conflict error
                    with templated functions.
           Product: D
           Version: 2.017
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: dsimcha at yahoo.com
It appears that the compiler does not properly handle collisions between
function names in different modules when one of the functions is a template.
Case 1:  Find is not templated in either std.string or std.regexp, compilation
fails with a conflicts error message.
import std.string, std.regexp;
void main() {
    int i = find("foobar", "foo");
}
Case 2:  Find is templated in std.algorithm, compiler silently tries to
instantiate std.algorithm.find, instantiation fails with error specific to
std.algorithm.find implementation.
import std.string, std.algorithm;
void main() {
    int i = find("foobar", "foo");
}
I've marked this bug as major because, if a user runs into it and is not aware
of it, it can be extremely difficult to figure out why the program doesn't
compile.
-- 
    
    
More information about the Digitalmars-d-bugs
mailing list