[Issue 1003] New: Weird error messages for duplicate function definitions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Feb 23 12:56:41 PST 2007


http://d.puremagic.com/issues/show_bug.cgi?id=1003

           Summary: Weird error messages for duplicate function definitions
           Product: D
           Version: 1.007
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: maxter at i.com.ua


<code>
char[] foo(char[] str)
{
        return str;
}

char[] foo(char[] str)
{
        return str;
}

void main()
{
        mixin(foo("int bar;"));
}
</code>

test.d(20): function test.foo called with argument types:
        (char[8])
matches both:
        test.foo(char[])
and:
        test.foo(char[])

The message for the run-time evaluated functions is no less weird. Remove
mixin(foo("int bar;")); and you get this from the linker: 
Error 1: Previous Definition Different : _D4test3fooFAaZAa


-- 



More information about the Digitalmars-d-bugs mailing list