[Issue 1320] New: delayed initialisation with the const attribute is broken in 2.0

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jul 6 02:15:42 PDT 2007


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

           Summary: delayed initialisation with the const attribute is
                    broken in 2.0
           Product: D
           Version: 2.000
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: thecybershadow at gmail.com


In http://digitalmars.com/d/attribute.html#const we have (some parts skipped):

const int x;

static this()
{
    x = 3;      // ok
}
// ---
class C
{
    const int a;

    this()
    {   
        a = 3;          // ok
    }
}

However, none of this code works with any 2.0 compiler for me.


-- 



More information about the Digitalmars-d-bugs mailing list