Bug 6298 – ref breaks struct immutability

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2011-07-12T11:52:00Z
Last change time
2011-07-12T13:05:59Z
Keywords
accepts-invalid
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2011-07-12T11:52:22Z
With DMD 2.054 this code compiles and runs, but I think this is not good: struct Foo { int x; } void bar(ref Foo f) { f.x++; } void main() { immutable Foo f; bar(f); }
Comment #1 by schveiguy — 2011-07-12T13:05:59Z
*** This issue has been marked as a duplicate of issue 5493 ***