www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10414] New: Delegate arguments for lazy variadic functions are only inferred in first argument

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: alexander.breckel gmail.com


--- Comment #0 from aneas <alexander.breckel 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: -------
Jun 19 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10414


Henning Pohl <henning still-hidden.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull, rejects-valid
                 CC|                            |henning still-hidden.de


--- Comment #1 from Henning Pohl <henning still-hidden.de> 2013-06-19 12:59:01
PDT ---
https://github.com/D-Programming-Language/dmd/pull/2228

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 19 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10414



--- Comment #2 from aneas <alexander.breckel gmail.com> 2013-06-19 13:24:45 PDT
---
(In reply to comment #1)
 https://github.com/D-Programming-Language/dmd/pull/2228
This pull request fixes the issue for me. Thanks! -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 19 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10414



--- Comment #3 from github-bugzilla puremagic.com 2013-06-27 21:53:06 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/f15dc0455718ca586f3c7d73354e49b43e0f9da8
fix issue 10414 - Delegate arguments for lazy variadic functions are
only inferred in first argument

https://github.com/D-Programming-Language/dmd/commit/33d0542342a42ad0562a409d5c3cc24397427c93
Merge pull request #2228 from hpohl/10414

fix issue 10414 - Delegate arguments for lazy variadic functions are only
inferred in first argument

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 27 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10414


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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