Bug 9290 – Ability to modify immutable struct members in static array assignment

Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-01-10T01:31:45Z
Last change time
2017-12-18T22:54:39Z
Keywords
accepts-invalid
Assigned to
No Owner
Creator
Denis Shelomovskii

Comments

Comment #0 by verylonglogin.reg — 2013-01-10T01:31:45Z
--- struct S { immutable int i; } void main() { S s1 = { 1 }, s2 = { 2 }; static assert(!__traits(compiles, s1 = s2)); // ok S[1] sArr1 = { 1 }, sArr2 = { 2 }; static assert(!__traits(compiles, sArr1 = s2)); // fails static assert(!__traits(compiles, sArr1 = sArr2)); // fails } ---
Comment #1 by mk — 2017-01-13T00:13:31Z
Comment #2 by github-bugzilla — 2017-11-19T02:00:29Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/7530807e1b6d0162fd040c4cfa98383b22d0a862 Fix Issue 9290 - Ability to modify immutable struct members in static array assignment https://github.com/dlang/dmd/commit/54e229d1b6583e32f651b58ac5786417959a42a2 Merge pull request #6435 from tramker/bug9290 Fix Issue 9290 - Ability to modify immutable struct members in static array assignment merged-on-behalf-of: Walter Bright <[email protected]>
Comment #3 by github-bugzilla — 2017-12-18T22:54:39Z
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/7530807e1b6d0162fd040c4cfa98383b22d0a862 Fix Issue 9290 - Ability to modify immutable struct members in static array assignment https://github.com/dlang/dmd/commit/54e229d1b6583e32f651b58ac5786417959a42a2 Merge pull request #6435 from tramker/bug9290