www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Type of a missing actual parameter

reply Manfred Nowak <svv1999 hotmail.com> writes:
The compiler accepts a dangling comma in a comma separated list of actual 
parameters.
What is the type of this missing actual parameter?

-manfred 
Oct 09 2013
next sibling parent reply "Dicebot" <public dicebot.lv> writes:
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 ); ```
Oct 09 2013
parent reply Manfred Nowak <svv1999 hotmail.com> writes:
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
Oct 09 2013
parent reply Manfred Nowak <svv1999 hotmail.com> writes:
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
Oct 09 2013
parent Manfred Nowak <svv1999 hotmail.com> writes:
Manfred Nowak wrote:

 I will file a bug report

Done: http://d.puremagic.com/issues/show_bug.cgi?id=11209 -manfred
Oct 09 2013
prev sibling next sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
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?
Oct 09 2013
prev sibling parent "Dicebot" <public dicebot.lv> writes:
Works for me: http://dpaste.dzfl.pl/86d226b1
Oct 09 2013