www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5981] New: Can't used post defined constant at compile-time

http://d.puremagic.com/issues/show_bug.cgi?id=5981

           Summary: Can't used post defined constant at compile-time
           Product: D
           Version: future
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: Jesse.K.Phillips+D gmail.com
                CC: Jesse.K.Phillips+D gmail.com



11:06:33 PDT ---
The following code compiles for 2.052 but fails in the beta for 2.053. This is
done in DFL.

break.d(3): Error: variable value cannot be read at compile time

class B {
static:
    ushort v2 = value;
    const ushort value = 342;
}
void main() {
}

You can fix this by moving the declaration up or by defining it as an enum.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 11 2011