Comment #0 by bearophile_hugs — 2010-04-02T14:49:25Z
(Not tested with the latest bug fixes, so this can be already fixed)
int foo() {
int[] arr = new int[1];
int s;
foreach (x; arr)
s += x;
foreach (x; arr)
s += x * x;
return 0;
}
enum int _ = foo();
void main() {}
dmd 2.042 gives:
Error: Integer constant expression expected instead of null
test.d(10): Error: cannot evaluate foo() at compile time
test.d(10): Error: cannot evaluate foo() at compile time