[Issue 13304] std.algorithm.reduce: "Unable to deduce an acceptable seed type" with float[]

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Aug 16 02:56:28 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=13304

--- Comment #2 from monarchdodra at gmail.com ---
(In reply to monarchdodra from comment #1)
> I'll give it a quick fix.

It turns out there is something that is making the compiler complain in my
tests, because it is trying to *actually* evaluate the predicate in test
(rather than just check compilability). This triggers it, because it complains
it has no access to source code. What's funny is that it works fine with string
predicate:

float sum = reduce!(binaryFun!"a + b")(nums); //OK!
float sum = reduce!((a,b) => a + b)(nums);    //NOPE!

This is weird. I wonder if there isn't another related regression or something.

I'm gonna try to reduce.

--


More information about the Digitalmars-d-bugs mailing list