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

Blatnik <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Array operation fails to    |Array operation fails to
                   |compile even though it      |compile even though it
                   |really shouldn'             |really should

--- Comment #1 from Blatnik <[email protected]> ---
float[3] add42(float[3] a)
{
    return a[] + 42;
}

Fails to compile with "Error: array operation `a[] + cast(float)3` without
destination memory not allowed."

But

float[3] add42(float[3] a)
{
    float[3] result = a[] + 42;
    return result;
}

compiles just fine. I'm not sure if this is a bug, but if it was intended, I
don't see a reason why we couldn't do that.

--

Reply via email to