www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19796] New: PR#1982 broke array ops

https://issues.dlang.org/show_bug.cgi?id=19796

          Issue ID: 19796

           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: regression
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: hsteoh quickfur.ath.cx

Code:
-------
import std.stdio;
void main() {
        double[] data = [ 0.5 ];
        writefln("data=%s", data);

        double[] result;
        result.length = data.length;
        result[] = -data[];
        import std.stdio;writefln("result=%s", result);
}
-------

Output:
-------
data=[0.5]
result=[0]
-------

Expected output:
-------
data=[0.5]
result=[-0.5]
-------

This regression was introduced by commit
d7b99e91e2de6cb9476e4826d5404d431b39dafd.

--
Apr 08 2019