www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1376] New: 2.003 const object within class

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1376

           Summary: 2.003 const object within class
           Product: D
           Version: 2.002
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: Daniel919 web.de


class A {
}

class B {
        //A a; // [OK]
        //const A a; // Error: this.a is not mutable [OK]
        //final const(A) a; // [OK]
        const(A) a; // Error: cannot modify const/invariant this.a [should
work]

        this(A a) {
                this.a = a;
        }
}


-- 
Jul 25 2007
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1376


clugdbug yahoo.com.au changed:

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





Works in DMD2.015


-- 
Jun 24 2008