Bug 1003 – Weird or missing error messages for duplicate function definitions

Status
RESOLVED
Resolution
DUPLICATE
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2007-02-23T14:56:00Z
Last change time
2014-02-16T15:25:33Z
Keywords
accepts-invalid, diagnostic
Assigned to
nobody
Creator
samukha
Blocks
2999

Comments

Comment #0 by samukha — 2007-02-23T14:56:31Z
<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
Comment #1 by smjg — 2010-12-03T17:37:30Z
*** Issue 5312 has been marked as a duplicate of this issue. ***
Comment #2 by yebblies — 2011-06-10T09:15:15Z
*** Issue 2703 has been marked as a duplicate of this issue. ***
Comment #3 by yebblies — 2011-06-10T09:15:19Z
*** Issue 4680 has been marked as a duplicate of this issue. ***
Comment #4 by yebblies — 2012-01-29T07:34:28Z
Whoops. Oh well, 2789 has a patch. *** This issue has been marked as a duplicate of issue 2789 ***