[Issue 8336] New: Default function parameters ignored by delegate

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jul 2 04:58:18 PDT 2012


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

           Summary: Default function parameters ignored by delegate
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: puneet at coverify.org


--- Comment #0 from Puneet Goel <puneet at coverify.org> 2012-07-02 05:00:57 PDT ---
This code worked for version 2.059. But with the latest git pull, it does not
compile, saying:
test.d(5): Error: expected 1 function arguments, not 0


void callfoo(alias F, T) (T t) {
  typeof(&Foo.init.foo) dg;
  dg.funcptr = &F;
  dg.ptr = cast(void *)t;
  dg();
}

class Foo {
  void foo(int n=2) {}
}

void main() {
  Foo f = new Foo();
  callfoo!(Foo.foo)(f);
}

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