[Issue 18091] New: "Error instantiating" cumulativeFold when passing a function inside another function
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Dec 16 21:43:00 UTC 2017
https://issues.dlang.org/show_bug.cgi?id=18091
Issue ID: 18091
Summary: "Error instantiating" cumulativeFold when passing a
function inside another function
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: normal
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: abc.mikey at gmail.com
DMD64 D Compiler v2.072.1
Best see with a test case:
import std.algorithm : cumulativeFold;
struct T {}
T t1(T a, int b) {
return T.init;
}
void main() {
auto arr = [0,1,1,0,0,0];
T t2(T a, int b) {
return T.init;
}
auto r1 = arr.cumulativeFold!( (a,b) => T.init )( T.init ); // no error
auto r2 = arr.cumulativeFold!t1( T.init ); // no error
//auto r3 = arr.cumulativeFold!t2( T.init ); // errors
}
--
More information about the Digitalmars-d-bugs
mailing list