http://d.puremagic.com/issues/show_bug.cgi?id=2562
Summary: foreach over uninitialized array fails in CTFE Product: D Version: 1.039 Platform: PC OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: bugzi...@digitalmars.com ReportedBy: clugd...@yahoo.com.au int foo() { int [] xxx; foreach(q; xxx) {} return 1; } static assert(foo()); ---- bug.d(8): Error: cannot evaluate foo() at compile time bug.d(8): static assert (foo()) is not evaluatable at compile time Workarounds: (1) Replace the foreach with for: for (int q=0; q<xxx.length; ++q) {} (2) Initialize the array int [] xxx = []; This is NOT the same as issue 1375, which appears to be fixed. --