www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1426] New: const(templated class) allows calling mutable methods

reply d-bugmail puremagic.com writes:
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 digitalmars.com
        ReportedBy: Daniel919 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


-- 
Aug 17 2007
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1426


Steven Schveighoffer <schveiguy yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |schveiguy yahoo.com
         Resolution|                            |FIXED



20:08:30 PDT ---
Unsure of the version this was fixed, but it works as of 2.041.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 16 2010