Skip to content

Commit c6195f7

Browse files
authored
[spec/statement] Foreach index type only needs to hold maximum array length (#3804)
Update for dlang/dmd#16334.
1 parent 4ecdc54 commit c6195f7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spec/statement.dd

+2-1
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,8 @@ foreach (i, char c; a)
561561
--------------
562562
)
563563
$(P For a dynamic array, the $(I index) type must be compatible
564-
with `size_t`.
564+
with `size_t`, unless the array length is statically known to fit
565+
in a smaller integer type.
565566
Static arrays may use any integral type that spans the length
566567
of the array.)
567568

0 commit comments

Comments
 (0)