www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1910] New: variadic function compilation failure

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1910

           Summary: variadic function compilation failure
           Product: D
           Version: 2.012
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: berzerger yandex.ru


Compiler fails (returns status code == 1) to compile this code:

int main(char[][] args)
{
  {
    /* variadic test */
    void variadicFoo(...)
    {
      foreach(info; _arguments)
      {
        writefln(info);
      }
    }

    variadicFoo(3, 3.0, 54.f, true);
  }
}

but all is ok when variadic function is not nested.


-- 
Mar 11 2008
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1910


smjg iname.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |smjg iname.com
             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME





I can't reproduce this.  Rather, I get these errors (2.019):

bz1910.d(9): Error: undefined identifier writefln
bz1910.d(9): Error: function expected before (), not writefln of type int
bz1910.d(1): function bz1910.main expected to return a value of type int

which is basically what should be happening.  If I fix the errors that led to
this, the program compiles and runs as expected.


-- 
Nov 20 2008