D-Programming-Language/dmd — pull request #1308 by AndrejMitrovic (2012-11-22 22:04:34+00:00)
Title: Fix Issue 8948 - Make error message more readable for function/delegate errors

This is a reimplementation of Pull #1248 which wasn't good because it was breaking IDE tools.

This pull keep the error message in one line but also prints additional information for 3 distinct cases:

- Mismatching parameter length:

```D
void function(int, float) a;
void function(int) b;
b = a;
```

```
Error: cannot implicitly convert expression (a) of type void function(int, float) to void function(int): Paramater count mismatch (2 vs 1)
```

- Mismatching parameter type:

```D
void function(int, float) a;
void function(int, int) b;
b = a;
```

```
Error: cannot implicitly convert expression (a) of type void function(int, float) to void function(int, int): Type mismatch at parameter #2 ('float' vs 'int')
```

- Mismatching calling convention (linkage):

```D
extern(C++) void function(int) a;
extern(C) void function(int) b;
b = a;
```

```
Error: cannot implicitly convert expression (a) of type extern (C++) void function(int) to extern (C) void function(int): Linkage mismatch ('C++' vs 'C')
```

Of course more cases could be added, for example mismatch of `pure` and `system` functions. I didn't add such a case because I know very little about purity and other such attributes, but it can easily be added by others after this pull is merged.