May 06, 2007 [Issue 1214] New: Using tuples to instanciate a delegate literal crashes compiler | ||||
---|---|---|---|---|
| ||||
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@digitalmars.com ReportedBy: jrs7561@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"); } -- |
September 09, 2007 [Issue 1214] Using tuples to instanciate a delegate literal crashes compiler | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=1214 dhasenan@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |DUPLICATE ------- Comment #1 from dhasenan@gmail.com 2007-09-09 16:26 ------- It seems that whenever I try to make progress on my Project Which Must Not Be Named, I find another one of these issues. In this case, in order to create a mock object, I need to create delegates based on the ReturnType and ParameterTypeTuple of a given function, and this prevents it. Anyway, yes, a duplicate, though now in DMD2 it's moved to glue.c:717. *** This bug has been marked as a duplicate of 854 *** -- |
Copyright © 1999-2021 by the D Language Foundation