[Issue 3866] anonymous delegate with default parameters cross-talks to another anonymous delegate

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jul 30 17:37:12 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=3866


Andrej Mitrovic <andrej.mitrovich at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich at gmail.com


--- Comment #10 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2012-07-30 17:37:07 PDT ---
Personally I never used default values in delegates but I think this pull broke
this real-world code from Derelict:

void loadPlatformGL(void delegate(void**, string, bool doThrow = true)
bindFunc)
{
    bindFunc(null, "foo1");
    bindFunc(null, "foo2");
    // ...
}

In this case the default value is useful since it's only used from within the
function, and it saves on typing since there are typically dozens of
invocations of the delegate (in Derelict).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list