D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 15818 - Multiple function declarations without definition cause ambiguity overloading error
Summary: Multiple function declarations without definition cause ambiguity overloading...
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 minor
Assignee: No Owner
URL:
Keywords: pull, rejects-valid
Depends on:
Blocks:
 
Reported: 2016-03-21 18:09 UTC by Denis Shelomovskii
Modified: 2019-06-28 13:00 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Denis Shelomovskii 2016-03-21 18:09:28 UTC
This code should compile:
---
void f(int); // line 1
void f(int);
void f(int);
void f(int);
void f(int); // line 5

void main()
{
    f(1); // line 9
}
---
main.d(9): Error: main.f called with argument types (int) matches both:
main.d(1):     main.f(int)
and:
main.d(5):     main.f(int)
---

If any declaration is converted to definition the code compiles.
Also note the error message only reports about the first and the last declaration.
Comment 1 Dlang Bot 2019-06-23 19:38:02 UTC
@Basile-z created dlang/dmd pull request #10077 "fix issue 15818 - Multiple function declarations without definition cause ambiguity overloading error" fixing this issue:

- fix issue 15818 - Multiple function declarations without definition cause ambiguity overloading error

https://github.com/dlang/dmd/pull/10077
Comment 2 Dlang Bot 2019-06-28 13:00:05 UTC
dlang/dmd pull request #10077 "fix issue 15818 - Multiple function declarations without definition cause ambiguity overloading error" was merged into master:

- fd3a47eba1b20ca582af42359394d7a51395bd04 by Basile Burg:
  fix issue 15818 - Multiple function declarations without definition cause ambiguity overloading error

https://github.com/dlang/dmd/pull/10077