D-Programming-Language/dmd — pull request #2672 by 9rnsr (2013-10-16 10:22:02+00:00)
Title: [REG2.063][enh] Issue 10684 - Refused array op with array literal

http://d.puremagic.com/issues/show_bug.cgi?id=10684

This change will accept array literals as the operand of array-ops.

---

Since, array-ops had required explicit slice to the array literal operands, eg. `a[] = [1,2][] + c[];`

By the commit:
https://github.com/9rnsr/dmd/commit/f703c5c6551affddd9213f759657a2b3e391b935
now the redundant slice operators at the right side of an array literal is entirely removed - `[1,2,3][][]` is rewritten to `[1,2,3]`.

Although it has broke existing code using array-ops, I still cannot think the optimization was incorrect.

On the other hand, I could not find the description about the necessity of explicit slice on array literal from the language spec.
http://dlang.org/arrays.html#array-operations
It looked to me that is just an implementation-specific restriction.

So, I implemented this as the easiest way to fix the issue. Therefore this is not only a regression fix, but also is a language enhancement.

Is this acceptable?