D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 1003 - Weird or missing error messages for duplicate function definitions
Summary: Weird or missing error messages for duplicate function definitions
Status: RESOLVED DUPLICATE of issue 2789
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Windows
: P2 minor
Assignee: No Owner
URL:
Keywords: accepts-invalid, diagnostic
: 2703 4680 5312 (view as issue list)
Depends on:
Blocks: 2999
  Show dependency treegraph
 
Reported: 2007-02-23 14:56 UTC by Max Samukha
Modified: 2014-02-16 15:25 UTC (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Max Samukha 2007-02-23 14:56:31 UTC
<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 Stewart Gordon 2010-12-03 17:37:30 UTC
*** Issue 5312 has been marked as a duplicate of this issue. ***
Comment 2 yebblies 2011-06-10 09:15:15 UTC
*** Issue 2703 has been marked as a duplicate of this issue. ***
Comment 3 yebblies 2011-06-10 09:15:19 UTC
*** Issue 4680 has been marked as a duplicate of this issue. ***
Comment 4 yebblies 2012-01-29 07:34:28 UTC
Whoops.  Oh well, 2789 has a patch.

*** This issue has been marked as a duplicate of issue 2789 ***