[Issue 10282] Refused assignment of vector op result to const array

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Oct 9 04:16:45 PDT 2014


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

bearophile_hugs at eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|diagnostic                  |

--- Comment #1 from bearophile_hugs at eml.cc ---
Now the error message is fixed:

test3.d(7,25): Error: invalid array operation 'a[] = f.x[] - f.x[]' for element
type const(double)


Some more examples:

void main() {
    int[3]           a1 = [1, 3, 6];
    int[3]           a2 = [1, 3, 6] * 3; // OK
    const     int[3] a3 = a1[] * 3;      // Error
    const     int[3] a4 = [1, 3, 6] * 3; // Error
    immutable int[3] a5 = [1, 3, 6] * 3; // Error
}



dmd 2.067alpha gives:

test.d(4,22): Error: _arraySliceExpMulSliceAssign_i (int[] p2, int c1,
const(int[]) p0) is not callable using argument types (const(int)[], int,
int[])
test.d(5,22): Error: _arraySliceExpMulSliceAssign_i (int[] p2, int c1,
const(int[]) p0) is not callable using argument types (const(int)[], int,
int[])
test.d(6,22): Error: _arraySliceExpMulSliceAssign_i (int[] p2, int c1,
const(int[]) p0) is not callable using argument types (immutable(int)[], int,
int[])

--


More information about the Digitalmars-d-bugs mailing list