Don <> changed:

           What    |Removed                     |Added
           Keywords|                            |CTFE, wrong-code
                 CC|                            |
            Summary|inconsistent foreach        |modifying foreach range
                   |behaviour in CTFE and at    |iterator fails in CTFE
                   |runtime                     |

--- Comment #1 from Don <> 2012-09-03 00:52:40 PDT ---
Here's a reduced test case. There are 10 iterations, even though the iteration
variable is changed.

int fun(){
    int r=0;
    foreach(i;0..10) {
       i= 100; 
       assert(i==100); // ok  -- but doesn't affect the foreach
    return r;
static assert(fun() == 1);

Interestingly this is in direct conflict with enhancement bug 6214, which asks
for the behaviour we see in CTFE to be used at run time.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to