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.
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 ***