Bug 8731 – Compiler allows multiple implementations of the same function signature
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-09-27T04:49:00Z
Last change time
2013-11-24T05:19:09Z
Keywords
accepts-invalid
Assigned to
nobody
Creator
schveiguy
Comments
Comment #0 by schveiguy — 2012-09-27T04:49:01Z
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.
Comment #1 by yebblies — 2013-11-24T05:19:09Z
*** This issue has been marked as a duplicate of issue 2789 ***