[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 03:08:15 PDT 2014


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

--- Comment #3 from monarchdodra at gmail.com ---
OK: Is this a rejects valid?

//----
import std.functional;

void main(string[] args)
{
    foo!(binaryFun!"a + b")();
    foo!((a,b) => a + b)();
}

void foo(alias pred)()
{
    alias A = Test1!int.Test2!pred;
}

template Test1(E)
{
    template Test2(alias pred)
    {    
    }    
}
//----
Error: template instance Test2!(__lambda2) cannot use local '__lambda2' as
parameter to non-global template Test2(alias pred)
Error: template instance main.main.foo!((a, b) => a + b) error instantiating

It doesn't quite explain the issue, but it still seems strange to me. my lambda
doesn't require context, so it shouldn't considered "local", should it? Also, I
don't understand the issue about "Global" template.

--


More information about the Digitalmars-d-bugs mailing list