Summary: enum + for loop = strange errors
           Product: D
           Version: 2.034
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: minor
          Priority: P2
         Component: DMD

--- Comment #0 from David Simcha <> 2009-10-13 09:10:38 PDT ---
enum FOO = 2;

void main() {
    for(uint i = 0; i < 2; i += FOO) {}

Results in a compile time error:

test.d(4): Error: variable FOO used before set

Marking as minor because it appears to be an extremely weird corner case bug. 
The only place I could reproduce it was when the enum is used in a for loop
like the above.

Also, changing FOO from enum to immutable resolves this.

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

Reply via email to