[Issue 15613] Parameter type mismatch error message are not very helpful

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Feb 26 22:56:28 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=15613

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

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

--- Comment #6 from Timothee Cour <timothee.cour2 at 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

--


More information about the Digitalmars-d-bugs mailing list