The following code results in a Segmentation fault: 11. The reason seems to be because "any" is called indefinitely. But if I don't use type inference for the lambda it works correctly.

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
}

Am I doing something wrong or is this a bug?

--
/Jacob Carlborg

Reply via email to