Comment #0 by bearophile_hugs — 2010-04-03T07:59:17Z
This D2 code asserts with dmd 2.042:
void foo(int[] ra) {
ra[0] = 20;
}
int[] bar() {
int[] data = [10];
foo(data);
return data;
}
void main() {
int[] r1 = bar();
assert(r1[0] == 20);
enum int[] r2 = bar();
assert(r2[0] == 20); // Assertion failure
}
This is quite important, because it introduces silent bugs.
It can be related to bug 1330.
Comment #1 by clugdbug — 2010-04-03T11:20:23Z
A very high fraction of CTFE bugs are either duplicates of bug 1330, or else blocked by it.
*** This issue has been marked as a duplicate of issue 1330 ***