Bug 15913 – cannot initialize immutable fixed size array without similar const-code

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-04-12T06:35:00Z
Last change time
2016-10-01T11:46:22Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
r.sagitario

Comments

Comment #0 by r.sagitario — 2016-04-12T06:35:24Z
This is an extraction from the dmd testsuite that is failing with LDC in the merge-2.071 branch. dmd behaves strangely, too: void test10282() { //const int[3] a4 = [1, 3, 6] * 3; immutable int[3] a5 = [1, 3, 6] * 3; } yields: Error: invalid array operation 'a5[] = [1, 3, 6] * 3' for element type immutable(int) while adding the commented line makes it compile.
Comment #1 by k.hara.pg — 2016-04-12T09:24:38Z
Comment #2 by github-bugzilla — 2016-05-07T06:36:50Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/260d3ded4a40f81fc614c9d4fd3020eddc1ae6b4 fix Issue 15913 - cannot initialize immutable fixed size array without similar const-code https://github.com/dlang/dmd/commit/fbca5f87d96901ba7e825274ee552a8c06af9b83 Merge pull request #5652 from 9rnsr/fix15913 Issue 15913 - cannot initialize immutable fixed size array without similar const-code
Comment #3 by github-bugzilla — 2016-10-01T11:46:22Z
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/260d3ded4a40f81fc614c9d4fd3020eddc1ae6b4 fix Issue 15913 - cannot initialize immutable fixed size array without similar const-code https://github.com/dlang/dmd/commit/fbca5f87d96901ba7e825274ee552a8c06af9b83 Merge pull request #5652 from 9rnsr/fix15913