ref return function using foreach ref result segfaults. Compiler bug?

2012-11-13 Thread Rob T
Hard to describe this problem, see code and read comments below. class A { private int _v; this( int a_v ) { _v = a_v; } @property size_t length() { return 1; } int opApply( int delegate( ref int a_v ) a_dg ) { int result = 0; for (

Re: ref return function using foreach ref result segfaults. Compiler bug?

2012-11-13 Thread Kenji Hara
On Tuesday, 13 November 2012 at 08:50:16 UTC, Rob T wrote: Hard to describe this problem, see code and read comments below. class A { private int _v; this( int a_v ) { _v = a_v; } @property size_t length() { return 1; } int opApply( int delegate(

Re: ref return function using foreach ref result segfaults. Compiler bug?

2012-11-13 Thread Rob T
On Tuesday, 13 November 2012 at 12:31:26 UTC, Kenji Hara wrote: This issue looks like bug8093. http://d.puremagic.com/issues/show_bug.cgi?id=8093 And the code works correctly in git head (dmd2.061alpha). Therefore, I think that the bug is fixed very recently. Kenji Hara Thanks for the