Bug 8390 – Refused array operation mutable[] += const[]

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2012-07-15T07:48:00Z
Last change time
2012-07-23T17:39:36Z
Keywords
rejects-valid
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2012-07-15T07:48:17Z
See Issue 4662 for some context. void main() { const int[] a = new int[5]; int[] b = new int[5]; b[] += a[]; } Gives, DMD 2.060alpha: test.d(4): Error: slice cast(const(int)[])b[] is not mutable
Comment #1 by github-bugzilla — 2012-07-23T17:37:09Z