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: nob...@puremagic.com
        ReportedBy: pun...@coverify.org


--- Comment #0 from Puneet Goel <pun...@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: -------

Reply via email to