www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9184] New: std.algorithm.all fails to compile when providing a lambda

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9184

           Summary: std.algorithm.all fails to compile when providing a
                    lambda
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: jens.k.mueller gmx.de



test.d
---
unittest                                                                        
{                                                                               
    import std.algorithm;                                                       
    assert(all!(a => a >= 0)([1, 2, 3]));                                     
}
---

$ dmd -unittest -run test.d
fails with 
Error: function test.__unittest3.not!(__lambda2).not!(int).not is a nested
function and cannot be accessed from std.algorithm.find!(not,int[]).find

Changing std.algorithm.all to
return find!((a) => !unaryFun!pred(a))(range).empty;
works.
Though I'm not sure whether this is an appropriate fix. Please advice that I
can create a pull request.

$ dmd | head -1
DMD64 D Compiler v2.060

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 19 2012
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9184




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/c834f350d11563f95246e79bae06a582e7fc2924
Fixes Issue 9184 - Document -op better.

https://github.com/D-Programming-Language/dmd/commit/e849215dc9572da80b88c322aead62b01d70e11a


[trivial] Issue 9184 - Document -op better.

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