[Issue 1214] New: Using tuples to instanciate a delegate literal crashes compiler

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat May 5 21:06:09 PDT 2007


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

           Summary: Using tuples to instanciate a delegate literal crashes
                    compiler
           Product: D
           Version: 1.014
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: jrs7561 at louisiana.edu


I'm pretty sure this should be legal,and if it's not it should definetly not
crash dmd.

The following code generates a crash with the message, "Assertion failure 0 on
line 710 in file 'glue.c'."

import std.stdio;

template Tuple(P...) {
    alias P Tuple;
}

alias Tuple!(int) where_t;
alias bool delegate(where_t) dgt;



int main(char[][] args) {
    doit((where_t j){ return(j[0] == 9); });
    return 0;
}

void doit(dgt exp) {
    for(int i = 0; i < 11; i++)
        if(exp(i))
            writefln("Success");
        else
            writefln("Failure");
}


-- 



More information about the Digitalmars-d-bugs mailing list