[Issue 10414] New: Delegate arguments for lazy variadic functions are	only inferred in first argument
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Wed Jun 19 08:23:07 PDT 2013
    
    
  
http://d.puremagic.com/issues/show_bug.cgi?id=10414
           Summary: Delegate arguments for lazy variadic functions are
                    only inferred in first argument
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: alexander.breckel at gmail.com
--- Comment #0 from aneas <alexander.breckel at gmail.com> 2013-06-19 08:23:06 PDT ---
import std.stdio;
void foo(void delegate()[] dgs ...) {
    foreach(dg; dgs)
        dg();
}
void main() {
    foo(
        { writeln(0); },    // first argument works!
        writeln(1),
        { writeln(2); },    // error #1
        () { writeln(3); }, // error #2
        delegate() { writeln(4); },
        delegate void() { writeln(6); }
    );
}
// test.d(12): Error: function has no effect in expression (__lambda2)
// test.d(13): Error: function has no effect in expression (__lambda3)
-- 
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