www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1993] New: Error calling vararg delegate with null


           Summary: Error calling vararg delegate with null
           Product: D
           Version: 1.028
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: chris dprogramming.com

Note the comments; the one is causing an error but should work:

void blah(bool delegate(char[][] words ...) callback)
        callback("foo", "bar"); // OK
        callback("foo"); // OK
        //callback(null, "bar"); // DMD 1.028: Error: expected 1 arguments, not
        callback(cast(char[])null, "bar"); // OK
        callback((char[]).init, "bar"); // OK

Apr 14 2008