| Thread overview | |||||||||
|---|---|---|---|---|---|---|---|---|---|
|
October 09, 2013 Type of a missing actual parameter | ||||
|---|---|---|---|---|
| ||||
The compiler accepts a dangling comma in a comma separated list of actual parameters. What is the type of this missing actual parameter? -manfred | ||||
October 09, 2013 Re: Type of a missing actual parameter | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Manfred Nowak | On Wednesday, 9 October 2013 at 12:33:07 UTC, Manfred Nowak wrote:
> The compiler accepts a dangling comma in a comma separated list of actual
> parameters.
> What is the type of this missing actual parameter?
>
> -manfred
There is no missing parameter. It is just a convenience syntax to avoid copy-paste mistakes. Those two are equivalent:
```
void foo( int, double, string, );
```
vs
```
void foo( int, double, string );
```
| |||
October 09, 2013 Re: Type of a missing actual parameter | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Dicebot | Dicebot wrote:
> Those two are equivalent:
Maybe right for functions, but is currently wrong for templated functions
`this( T ...)( T param)'
I got a "Range violation" on accessing the last parameter of `param'.
Maybe the parameters are wongly counted?
-manfred
| |||
October 09, 2013 Re: Type of a missing actual parameter | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Manfred Nowak | On 10/9/13, Manfred Nowak <svv1999@hotmail.com> wrote:
> Maybe the parameters are wongly counted?
I doubt it. Do you have a test-case?
| |||
October 09, 2013 Re: Type of a missing actual parameter | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Manfred Nowak | Works for me: http://dpaste.dzfl.pl/86d226b1 | |||
October 09, 2013 Re: Type of a missing actual parameter | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Andrej Mitrovic | Andrej Mitrovic wrote:
> Do you have a test-case?
On reducing the case it turned out, that the error message blaimed the wrong file for a really existing "Range violation". By pure chance the lines in the wrongly given file were these:
AST[] astStar= visit( data.ast[0]);
foreach( elem; data.ast[ 1 .. $])
astStar~= visit( elem);
// <-- erroneous line
--- and the second parameter was missing, but the `,' was introduced by
another bug.
I will file a bug report on "error message gives wrong filename".
-manfred
| |||
October 09, 2013 Re: Type of a missing actual parameter | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Manfred Nowak | Manfred Nowak wrote: > I will file a bug report Done: http://d.puremagic.com/issues/show_bug.cgi?id=11209 -manfred | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply