Jump to page: 1 2
Thread overview
[Issue 15613] Parameter type mismatch error message are not very helpful
Jan 27, 2016
Ketmar Dark
Dec 30, 2017
Nick Treleaven
Dec 30, 2017
Nick Treleaven
Jan 02, 2018
Nick Treleaven
Feb 26, 2018
Timothee Cour
Apr 01, 2021
Dlang Bot
Apr 02, 2021
Dlang Bot
Oct 31, 2022
RazvanN
Nov 01, 2022
ponce
January 27, 2016
https://issues.dlang.org/show_bug.cgi?id=15613

Ketmar Dark <ketmar@ketmar.no-ip.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ketmar@ketmar.no-ip.org

--- Comment #1 from Ketmar Dark <ketmar@ketmar.no-ip.org> ---
or, at least, as a (possibly) simplier solution — prettyprint both declarations
on separate lines, aligning arguments (possibly ommiting argument names), so it
can be easily visually compared.

--
December 30, 2017
https://issues.dlang.org/show_bug.cgi?id=15613

Nick Treleaven <nick@geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nick@geany.org

--- Comment #2 from Nick Treleaven <nick@geany.org> ---
https://github.com/dlang/dmd/pull/7554

It shows the argument that failed (and matching parameter) rather than
parameter index.

--
December 30, 2017
https://issues.dlang.org/show_bug.cgi?id=15613

Nick Treleaven <nick@geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |johnnymarler@gmail.com

--- Comment #3 from Nick Treleaven <nick@geany.org> ---
*** Issue 16165 has been marked as a duplicate of this issue. ***

--
January 02, 2018
https://issues.dlang.org/show_bug.cgi?id=15613

Nick Treleaven <nick@geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs@eml.cc

--- Comment #4 from Nick Treleaven <nick@geany.org> ---
*** Issue 9056 has been marked as a duplicate of this issue. ***

--
January 26, 2018
https://issues.dlang.org/show_bug.cgi?id=15613

--- Comment #5 from github-bugzilla@puremagic.com ---
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/48c6b49605e265e043e9a37fe6064ec603679619 Fix Issue 15613 - Parameter type mismatch error message not very helpful

Show the first argument that fails to match the function parameters.
This is also part of:
Issue 9631 - Error message not using fully qualified name when appropriate

https://github.com/dlang/dmd/commit/fcc69c18c439009508e1e57ea1f91970ffdf9b2b Merge pull request #7554 from ntrel/qual-arg

Fix Issue 15613, 11529: Show parameter mismatch and rvalue/lvalue ref message merged-on-behalf-of: Sebastian Wilzbach <sebi.wilzbach@gmail.com>

--
January 26, 2018
https://issues.dlang.org/show_bug.cgi?id=15613

github-bugzilla@puremagic.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--
February 26, 2018
https://issues.dlang.org/show_bug.cgi?id=15613

Timothee Cour <timothee.cour2@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |timothee.cour2@gmail.com
         Resolution|FIXED                       |---

--- Comment #6 from Timothee Cour <timothee.cour2@gmail.com> ---
re-opening, as the fix doesn't work with overloads:

```
--- main.d
void fun(int a, double b){}
version(with_overload)
void fun(double a, int b){}

void main(){
  fun(1.1, 2.1);
}
```

dmd main.d
Error: function test_all.fun(int a, double b) is not callable using argument
types (double, double)
cannot pass argument 1.1 of type double to parameter int a

dmd -version=with_overload main.d
Error: none of the overloads of fun are callable using argument types (double,
double), candidates are:
test_all.fun(int a, double b)
test_all.fun(double a, int b)

with -version=with_overload , it should show a similar error showing where parameters mis-matcch

--
April 01, 2021
https://issues.dlang.org/show_bug.cgi?id=15613

--- Comment #7 from Dlang Bot <dlang-bot@dlang.rocks> ---
@ibuclaw created dlang/dmd pull request #12339 "[dmd-cxx] Backport fixes and trivial features from upstream dmd" mentioning this issue:

- [dmd-cxx] Fix Issue 15613, 11529: Show parameter mismatch and rvalue/lvalue ref message

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

--
April 02, 2021
https://issues.dlang.org/show_bug.cgi?id=15613

--- Comment #8 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #12339 "[dmd-cxx] Backport fixes and trivial features from upstream dmd" was merged into dmd-cxx:

- 8f461425adb1e69bf02abf88b4e73585316b05af by Nick Treleaven:
  [dmd-cxx] Fix Issue 15613, 11529: Show parameter mismatch and rvalue/lvalue
ref message

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

--
October 31, 2022
https://issues.dlang.org/show_bug.cgi?id=15613

RazvanN <razvan.nitu1305@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
                 CC|                            |razvan.nitu1305@gmail.com
         Resolution|---                         |FIXED

--- Comment #9 from RazvanN <razvan.nitu1305@gmail.com> ---
The initial issue has been fixed, please do not reopen but file a new bug report when new manifestations of the bug appear.

Now, for the overload example, I don't think that we should also take care of that one too. It has been the philosophy of D to not be too verbose with error messages. Imagine that if you have more than 2 functions in the overload set you will be littered with all of the information. I think that the current output is very nice and helpful:

test.d(6): Error: none of the overloads of `fun` are callable using argument
types `(double, double)`
test.d(1):        Candidates are: `test.fun(int a, double b)`
test.d(3):                        `test.fun(double a, int b)`

I think that this is enough. Anyway, if you do not agree, please file a new issue as this one has been fixed already.

--
« First   ‹ Prev
1 2