[Issue 8731] New: Compiler allows multiple implementations of the same function signature

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Sep 27 04:48:24 PDT 2012


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

           Summary: Compiler allows multiple implementations of the same
                    function signature
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: schveiguy at yahoo.com


--- Comment #0 from Steven Schveighoffer <schveiguy at yahoo.com> 2012-09-27 04:49:01 PDT ---
Example:

testme2.d:
module testme2;
import std.stdio;

void foo()
{
    writeln("first");
}

void foo()
{
    writeln("second");
}


testme2.di:
module testme2;

void foo();

testme.d:
import testme2;

void main()
{
    foo();
}


Compiled like this:

# dmd -c testme2.d
# dmd testme.d testme2.o
# ./testme
first
#

Clearly, there should be an error somewhere in here.  Listing the asm of
testme2.o shows two of the exact same symbol.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list