[Issue 13154] New: Incorrect init of static float array when sliced
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Thu Jul 17 23:25:29 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=13154
Issue ID: 13154
Summary: Incorrect init of static float array when sliced
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: regression
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: dbugreporter at gmail.com
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.
--
More information about the Digitalmars-d-bugs
mailing list