[Issue 2325] New: using alias template parameter with anonymous delegate before passing it on crashes compiler

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Sep 1 05:34:01 PDT 2008


http://d.puremagic.com/issues/show_bug.cgi?id=2325

           Summary: using alias template parameter with anonymous delegate
                    before passing it on crashes compiler
           Product: D
           Version: 1.026
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: fawzi at gmx.ch


the following code fails to compile

{{{
int f(alias g)(int x){
    return g(x);
}

int h(alias g)(int x){
    int y=x;
    y=g(x); // this line makes the compiler crash
    return f!(g)(y);
}

void main(){
    int y,z;
    y=h!((int x){return 2*x;})(z); // fails only with inline delegate
}
}}}


-- 



More information about the Digitalmars-d-bugs mailing list