Bug 1426 – const(templated class) allows calling mutable methods

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2007-08-17T08:57:00Z
Last change time
2015-06-09T01:14:14Z
Keywords
accepts-invalid
Assigned to
nobody
Creator
Daniel919
Blocks
2573

Comments

Comment #0 by Daniel919 — 2007-08-17T08:57:29Z
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
Comment #1 by schveiguy — 2010-03-16T20:08:30Z
Unsure of the version this was fixed, but it works as of 2.041.