[Issue 8430] New: [2.060 beta] Default arguments ignored for delegates/function pointers

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jul 24 22:48:27 PDT 2012


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

           Summary: [2.060 beta] Default arguments ignored for
                    delegates/function pointers
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: sludwig at outerproduct.org


--- Comment #0 from Sönke Ludwig <sludwig at outerproduct.org> 2012-07-24 22:48:25 PDT ---
The following used to work in 2.059. Not sure if default args are supposed to
work at all, but in case they are not, they should not be accepted at
declaration site in the first place.

---
void main()
{
    void delegate(int arg = 0) del;
    del(); // error

    void function(int arg = 0) fun;
    fun(); // error
}
---

delegate_defarg.d(4): Error: expected 1 function arguments, not 0
delegate_defarg.d(7): Error: expected 1 function arguments, not 0

-- 
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