[Issue 1376] New: 2.003 const object within class

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jul 25 15:08:19 PDT 2007


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 at digitalmars.com
        ReportedBy: Daniel919 at 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;
        }
}


-- 



More information about the Digitalmars-d-bugs mailing list