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

--- Comment #0 from 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 b){return (T n){return b.f(b,n);};});

void main(){
    auto factorial=Y((long delegate(long) self){return (long i){return
    auto fibonacci=Y((int delegate(int) self){return (int i){return
    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:
------- You are receiving this mail because: -------

Reply via email to