Thread overview
[Issue 1320] New: delayed initialisation with the const attribute is broken in 2.0
Jul 06, 2007
d-bugmail
Jul 06, 2007
d-bugmail
[Issue 1320] Attributes spec uses 1.0 const semantics in 2.0 section
Jul 06, 2007
d-bugmail
Jul 30, 2007
d-bugmail
July 06, 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@digitalmars.com
        ReportedBy: thecybershadow@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.


-- 

July 06, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1320


bugzilla@digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




------- Comment #1 from bugzilla@digitalmars.com  2007-07-06 11:23 -------
That's as designed. Use 'final' for delayed initialization.


-- 

July 06, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1320


deewiant@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |http://digitalmars.com/d/att
                   |                            |ribute.html#const
           Severity|major                       |normal
             Status|RESOLVED                    |REOPENED
           Keywords|rejects-valid               |spec
         OS/Version|Windows                     |All
           Priority|P2                          |P3
           Platform|PC                          |All
         Resolution|INVALID                     |
            Summary|delayed initialisation with |Attributes spec uses 1.0
                   |the const attribute is      |const semantics in 2.0
                   |broken in 2.0               |section
            Version|2.000                       |2.001




------- Comment #2 from deewiant@gmail.com  2007-07-06 11:27 -------
Then it's a documentation issue. The 2.0 section shouldn't use code which only works in 1.0.


-- 

July 30, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1320


bugzilla@digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED




------- Comment #3 from bugzilla@digitalmars.com  2007-07-30 15:50 -------
Fixed DMD 2.003


--