← Back to index
|
Original Bugzilla link
Bug 8365 – Static fixed size array of enums initialization fails
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-07-09T14:49:00Z
Last change time
2013-12-19T04:24:48Z
Keywords
CTFE, pull, rejects-valid
Assigned to
nobody
Creator
tommitissari
Comments
Comment #0
by tommitissari — 2012-07-09T14:49:44Z
module main; immutable(int[2]) ints = { int[2] tempInts; // #0: OK for (int i = 0; i < 2; ++i) { tempInts[i] = i; } return cast(immutable) tempInts; }(); // #1: OK enum MyEnum { first, second, third, fourth } immutable(MyEnum[2]) enums = { MyEnum[2] tempEnums; // #2 for (int i = 0; i < 2; ++i) { tempEnums[i] = cast(MyEnum) i; } return cast(immutable) tempEnums; }(); // #3 void main(string[] args) { } // #2: Error: Array length mismatch assigning [0..0] to [0..2] // #3: Error: called from here: (*delegate pure nothrow @safe immutable(MyEnum[2u])()
Comment #1
by yebblies — 2013-11-26T07:34:07Z
https://github.com/D-Programming-Language/dmd/pull/2883
Comment #2
by github-bugzilla — 2013-12-10T07:43:16Z
Commits pushed to master at
https://github.com/D-Programming-Language/dmd
https://github.com/D-Programming-Language/dmd/commit/a59cf5b310fbac573aca600725d826201ee1a2a1
Fix Issue 8365 - Static fixed size array of enums initialization fails
https://github.com/D-Programming-Language/dmd/commit/7fe5f320390412734274af02329a04cb79c44264
Merge pull request #2883 from yebblies/issue8365 Issue 8365 - Static fixed size array of enums initialization fails
Comment #3
by github-bugzilla — 2013-12-19T04:24:48Z
Commits pushed to 2.065 at
https://github.com/D-Programming-Language/dmd
https://github.com/D-Programming-Language/dmd/commit/a59cf5b310fbac573aca600725d826201ee1a2a1
Fix Issue 8365 - Static fixed size array of enums initialization fails
https://github.com/D-Programming-Language/dmd/commit/7fe5f320390412734274af02329a04cb79c44264
Merge pull request #2883 from yebblies/issue8365