D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 1972 - Foreach range statement breaks CTFE
Summary: Foreach range statement breaks CTFE
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: Walter Bright
URL:
Keywords: patch, rejects-valid
Depends on:
Blocks: 3058
  Show dependency treegraph
 
Reported: 2008-04-05 11:09 UTC by Max Samukha
Modified: 2015-06-09 01:14 UTC (History)
1 user (show)

See Also:


Attachments
Fix the problem (DMD 2.030) (638 bytes, patch)
2009-06-05 12:24 UTC, Shin Fujishiro
Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description Max Samukha 2008-04-05 11:09:39 UTC
----
int foo()
{
    foreach (c; '0' .. '9')
    {
    }
    
    return 0;
}

enum x = foo();
----
Error: cannot evaluate foo() at compile time
Comment 1 Shin Fujishiro 2009-06-05 12:24:42 UTC
Created attachment 393 [details]
Fix the problem (DMD 2.030)
Comment 2 Walter Bright 2009-09-03 13:33:22 UTC
Fixed dmd 2.032