December 03, 2011 [Issue 7057] New: Compiler errors on different functions on argument mismatch | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=7057 Summary: Compiler errors on different functions on argument mismatch Product: D Version: D2 Platform: Other OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: andrej.mitrovich@gmail.com --- Comment #0 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2011-12-02 17:47:47 PST --- struct Foo { void test(int) { } void test(int, int, string, string, int) { } } void main() { Foo foo; foo.test(0, 0, "", ""); } test.d(10): Error: function test.Foo.test (int _param_0) is not callable using argument types (int,int,string,string) test.d(10): Error: expected 5 function arguments, not 4 This is extremely confusing in a library that has multiple function overloads. The compiler first prints out the first function, but then prints out the argument count of the second function which was the best match. It should *not* talk about the first function at all if the second is more likely a match. The error message should be: test.d(10): Error: function test.Foo.test (int _param_0,int _param_1,string _param_2,string _param_3) is not callable using argument types (int,int,string,string) test.d(10): Error: expected 5 function arguments, not 4 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
September 17, 2013 [Issue 7057] Compiler errors on different functions on argument mismatch | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrej Mitrovic | http://d.puremagic.com/issues/show_bug.cgi?id=7057 Andrej Mitrovic <andrej.mitrovich@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |LATER --- Comment #1 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-09-17 14:44:27 PDT --- Walter pulled out the additional diagnostics (which kinda solves this issue), but I hope we can pull them back in again at a later point and then also fix them. I'm marking this for later. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation