[Issue 1426] New: const(templated class) allows calling mutable methods

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Aug 17 06:57:31 PDT 2007


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

           Summary: const(templated class) allows calling mutable methods
           Product: D
           Version: 2.003
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: Daniel919 at web.de


class Foo(T) {
        void bar() {}
}

const(Foo!(int)) foo = new Foo!(int)();
foo.bar();

It's working, but it should fail with:
Error: foo.bar can only be called on a mutable object


-- 



More information about the Digitalmars-d-bugs mailing list