digitalmars.D.bugs - [Issue 1801] New: Const structs should be assignable to non-const variables unless they contain references
- d-bugmail puremagic.com (28/28) Jan 23 2008 http://d.puremagic.com/issues/show_bug.cgi?id=1801
- d-bugmail puremagic.com (9/9) Mar 06 2008 http://d.puremagic.com/issues/show_bug.cgi?id=1801
http://d.puremagic.com/issues/show_bug.cgi?id=1801 Summary: Const structs should be assignable to non-const variables unless they contain references Product: D Version: 2.010 Platform: PC OS/Version: All Status: NEW Keywords: rejects-valid, spec Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: ludwig informatik.uni-luebeck.de For structs not containing any reference values (like pointers, class references, arrays etc.) and have not fields which are not assignable for this reason (structs/unions with references). // should be allowed, pure copy: struct S { int x; } const S s_const = {0}; S s_mutable = s_const; // currently not allowed On a related note, initialization of constant variables should be possible, even if the source value is constant: struct S1 { int x; } struct S2 { S1 s1; } const S1 s1_const = {0}; const S2 s2_const = {s1_const}; // currently not allowed --
Jan 23 2008
http://d.puremagic.com/issues/show_bug.cgi?id=1801 bugzilla digitalmars.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED Fixed dmd 2.012 --
Mar 06 2008