[Issue 12985] New: Better error message for not supported array operation

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Jun 24 14:35:22 PDT 2014


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

          Issue ID: 12985
           Summary: Better error message for not supported array operation
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: bearophile_hugs at eml.cc

void foo(int[] b) {}
void main() {
    int[2] a = [1, 2];
    foo(a[] * 2);
}


dmd 2.066alpha gives:

test.d(4,9): Error: array operation a[] * 2 without assignment not implemented


I suggest a better error message like:

test.d(4,9): Error: array operations that allocate memory are not supported for
performance reasons


See also issue 10307

--


More information about the Digitalmars-d-bugs mailing list