Modifying public struct property using foreach statement
Submitted by sta..@..il.com
Link to original bug (#676933)
Description
public struct Test { public int x;
public Test(int x)
{
this.x = x;
}
}
Test[] test;
void main (string[] args) { test += Test(1); test += Test(2); test += Test(3);
foreach(unowned Test t in test)
t.x++;
test[2].x++;
foreach(unowned Test t in test)
stdout.printf("x=%d\n", t.x);
}
/* OUTPUT: x=1 x=2 x=4 */
Version: 0.16.x