Summary: Array ops that return value to a new array should work.
           Product: D
           Version: 2.022
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD

import std.stdio;

void main() {
    double[] foo = [1.0,2,3,4,5].dup;
    double[] bar = [6.0,7,8,9,10].dup;
    auto baz = foo[] + bar[]; //Error: Array operation foo[] + bar[] not 


Ideally, the compiler should create baz and put the result of foo[] + bar[] in
this newly created array.  If the goal of not allowing this behavior is to
avoid hidden memory allocations, then a more informative error message should
be displayed.


Reply via email to