[Issue 9271] New: Forwarding lambda predicate with type inference causes segfault

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jan 5 03:43:58 PST 2013


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

           Summary: Forwarding lambda predicate with type inference causes
                    segfault
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: doob at me.com


--- Comment #0 from Jacob Carlborg <doob at me.com> 2013-01-05 03:43:55 PST ---
The following code results in a segmentation fault. It seems that "any" is
called indefinitely. If I don't use type inference for the lambda everything
works as it should.

import algorithm = std.algorithm;

bool any (alias predicate, Range) (Range range)
{
    return algorithm.any!(predicate)(range);
}

void main ()
{
    auto arr = ["foo"];
    any!(e => e == "asd")(arr); // segfault 
    // any!((string e) => e == "asd")(arr); // works 
}

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