The assertion fails in the following program (I was able to fix it in my back-end for .NET but it is probably best for a fix to go into the front-end). struct X { int i; this(this) { ++i; } } void main() { X [1] xs; xs[0] = X(); foreach(x; xs) { assert(x.i == 1); } }
Created attachment 349 [details] test case
Similar to BUG 2674.
Fixed dmd 2.032