http://d.puremagic.com/issues/show_bug.cgi?id=8722
monarchdo...@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |monarchdo...@gmail.com --- Comment #2 from monarchdo...@gmail.com 2012-09-25 02:26:59 PDT --- Additional information: The first example makes my dmd 2.060 crash actually (!) Note that the two examples are not *strictly* equivalent, as foreach(element) will make a copy of each element, whereas: foreach ( i; 0 .. array.length ) whatever( array[i] ) Will access each element by reference. Changing the first code snippet to: //----------------------------- void whatever( T )( in ref T array ) { static if ( isArray!( T ) ) foreach ( ref element; array ) //HERE: REF whatever( element ); } void main() { int[0][2][3] array; whatever( array ); } //----------------------------- Works. Either way, there is something wrong in there, if dmd is crashing. Besides, the code is legit, and should not produce a floating point exception either. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------