Bug 13154 – Incorrect init of static float array when sliced

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-07-18T06:25:00Z
Last change time
2014-08-22T08:04:40Z
Keywords
pull, wrong-code
Assigned to
nobody
Creator
dbugreporter

Comments

Comment #0 by dbugreporter — 2014-07-18T06:25:29Z
void main() { int[3] ints = [2 , 1 , 0 , 1 ][0..3]; float[3] floats0 = [2f , 1f , 0f , 1f ][0..3]; float[3] floats1 = [2.0 , 1.0 , 0.0 , 1.0 ][0..3]; // fails! float[3] floats2 = [2.0f, 1.0f, 0.0f, 1.0f][0..3]; assert(ints == [2, 1, 0]); assert(floats0 == [2, 1, 0]); assert(floats1 == [2, 1, 0]); // fail! assert(floats1 != [0, 0, 0]); // fail! assert(floats2 == [2, 1, 0]); } All this still worked with v.2065.
Comment #1 by k.hara.pg — 2014-07-18T13:31:07Z
Comment #2 by github-bugzilla — 2014-07-19T04:18:09Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/41c9adce2818e469c32af2c7cfba61f906c4623a fix Issue 13154 - Incorrect init of static float array when sliced https://github.com/D-Programming-Language/dmd/commit/39f6d3b508cf26fdc43d9b226c1704f05ffd5061 Merge pull request #3783 from 9rnsr/fix13154 [REG2.066a] Issue 13154 - Incorrect init of static float array when sliced
Comment #3 by github-bugzilla — 2014-07-20T20:59:52Z
Commit pushed to 2.066 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/f27f205d17ca44ed0984961b0a8f4ab54fb44b13 Merge pull request #3783 from 9rnsr/fix13154 [REG2.066a] Issue 13154 - Incorrect init of static float array when sliced
Comment #4 by github-bugzilla — 2014-08-22T08:04:40Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/f27f205d17ca44ed0984961b0a8f4ab54fb44b13 Merge pull request #3783 from 9rnsr/fix13154 [REG2.066a] Issue 13154 - Incorrect init of static float array when sliced