digitalmars.D - Type of a missing actual parameter
- Manfred Nowak (4/4) Oct 09 2013 The compiler accepts a dangling comma in a comma separated list of actua...
- Dicebot (10/15) Oct 09 2013 There is no missing parameter. It is just a convenience syntax to
- Manfred Nowak (6/7) Oct 09 2013 Maybe right for functions, but is currently wrong for templated function...
- Andrej Mitrovic (2/3) Oct 09 2013 I doubt it. Do you have a test-case?
- Manfred Nowak (12/13) Oct 09 2013 On reducing the case it turned out, that the error message blaimed the
- Manfred Nowak (4/5) Oct 09 2013 Done:
- Dicebot (1/1) Oct 09 2013 Works for me: http://dpaste.dzfl.pl/86d226b1
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
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? -manfredThere 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
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
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
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
Manfred Nowak wrote:I will file a bug reportDone: http://d.puremagic.com/issues/show_bug.cgi?id=11209 -manfred
Oct 09 2013