http://d.puremagic.com/issues/show_bug.cgi?id=7428
Summary: regression (DMD 2.058head) ICE on slightly convoluted setup including closures Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: regression Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: timon.g...@gmx.ch --- Comment #0 from timon.g...@gmx.ch 2012-02-02 15:45:57 PST --- The following code compiles and runs fine with DMD 2.057, but fails on DMD 2.058head with Internal error: toir.c 178 // import std.stdio, std.algorithm, std.range; auto Y(R,T...)(R delegate(T) delegate (R delegate(T)) f){ struct F{R delegate(F,T) f;}; return (R delegate(T)delegate(F) a){return a(F((F b,T i){return f(a(b))(i);})); }((F b){return (T n){return b.f(b,n);};}); } void main(){ auto factorial=Y((long delegate(long) self){return (long i){return i?self(i-1)*i:1;};}); auto fibonacci=Y((int delegate(int) self){return (int i){return i<2?i:self(i-1)+self(i-2);};}); auto ackermann=Y((long delegate(long,long) self){return (long n,long m){return n?m?self(n-1,self(n,m-1)):self(n-1,1):m+1;};}); // writeln(map!factorial(iota(0,20))); // writeln(map!fibonacci(iota(0,20))); // writeln(map!((a){return ackermann(a%4,a/4);})(iota(0,20))); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------