@@ -187,8 +187,11 @@ assert(a is b);
187187 using pointer $(RELATIVE_LINK2 slicing, slicing), so that the number of elements
188188 to copy is then known.)
189189
190+
191+ $(H3 $(LNAME2 static-array-assign, Static Array Assignment))
192+
190193 $(P A static array can be assigned from a dynamic array - the data is copied.
191- The lengths must match:)
194+ If the lengths do not match at runtime, a `RangeError` is thrown :)
192195
193196$(SPEC_RUNNABLE_EXAMPLE_RUN
194197---
@@ -352,12 +355,10 @@ i = bar[$-1]; // retrieves last element of the array
352355
353356$(H2 $(LNAME2 array-copying, Array Copying))
354357
355- $(P When the slice operator appears as the left-hand side of an
356- assignment expression, it means that the contents of the array are the
357- target of the assignment rather than a reference to the array.
358- Array copying happens when the left-hand side is a slice, and the
359- right-hand side is an array of or pointer to the same type.
360- )
358+ $(P When a slice expression is the left-hand side of an
359+ assignment expression, it means that the contents of the slice are the
360+ target of the assignment rather than an array reference.
361+ The right-hand side must implicitly convert to an array type.)
361362
362363$(SPEC_RUNNABLE_EXAMPLE_RUN
363364---------
@@ -382,6 +383,11 @@ assert(a == [2, 0]);
382383---------
383384)
384385
386+ $(P If the number of elements does not match at runtime, a `RangeError` is thrown.)
387+
388+ $(RATIONALE Indexing past the end of a slice is a programming error.)
389+
390+
385391$(H3 $(LNAME2 overlapping-copying, Overlapping Copying))
386392
387393 $(P Overlapping copies are an error:)
0 commit comments