Bug 16248 – nested const functions can mutate the aggregate members

Status
RESOLVED
Resolution
WONTFIX
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-07-07T12:31:02Z
Last change time
2018-12-28T23:26:43Z
Assigned to
No Owner
Creator
Basile-z

Comments

Comment #0 by b2.temp — 2016-07-07T12:31:02Z
This compiles without error struct Foo { int i; void bar() { void foo() const /*immutable as well*/ { i = 1; } foo; } }
Comment #1 by b2.temp — 2016-07-08T04:34:28Z
Maybe a message that indicates that const means nothing in this context.
Comment #2 by b2.temp — 2018-12-28T23:26:43Z
This is part of a longer story D has with attributes that can be noop.