Bug 1993 – Error calling vararg delegate with null
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
All
OS
All
Creation time
2008-04-14T10:45:00Z
Last change time
2014-02-24T15:31:00Z
Keywords
patch, rejects-valid
Assigned to
nobody
Creator
chris
Comments
Comment #0 by chris — 2008-04-14T10:45:01Z
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 2
callback(cast(char[])null, "bar"); // OK
callback((char[]).init, "bar"); // OK
}