https://dlang.org/spec/arrays.html 12.9.4 "The slice on the left and any slices on the right must not overlap."
Please clarify what this means and give an example of an error.
The following compiles and runs without errors despite left and right overlap (in fact they are the same):
void main() {
auto a = [3.0, 2.7, 3.4];
auto b = [2.3, 1.4, 2.5];
a[] = a[] + a[];
}
Is the above an undefined behavior? In this case, the spec should explicitly mention undefined behavior and the compiler should give an error/warning.
Comment #1 by robert.schadek — 2024-12-15T15:26:30Z