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

           Summary: Can't access a global enum size_t from a pure function
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2012-09-18 20:04:01 PDT ---
int[1] foo;
enum fooLength = 1;
void main() pure {
    auto n1 = fooLength; // OK
    auto n2 = foo.length; // error
}



DMD 2.061alpha shows:

test.d(5): Error: pure function 'D main' cannot access mutable static data
'foo'


But foo.length is a compile-time constant.

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

Reply via email to