[Issue 6298] New: ref breaks struct immutability
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Jul 12 11:57:31 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6298
Summary: ref breaks struct immutability
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Keywords: accepts-invalid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2011-07-12 11:52:22 PDT ---
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);
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list