From 23f6757be95a0bf930ab090c72e5b46d773cdecd Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Fri, 10 May 2024 16:03:18 +0100 Subject: [PATCH] Add changelog for #16334 (#16470) --- changelog/dmd.foreach-array-index-type.dd | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 changelog/dmd.foreach-array-index-type.dd diff --git a/changelog/dmd.foreach-array-index-type.dd b/changelog/dmd.foreach-array-index-type.dd new file mode 100644 index 0000000000..df1a415ce5 --- /dev/null +++ b/changelog/dmd.foreach-array-index-type.dd @@ -0,0 +1,12 @@ +`foreach` on a dynamic array can have an index type smaller than `size_t` + +The array length is known at compile-time for the following cases: + +* The array is a literal +* The array is a slice expression whose upper bound is known at + compile-time + +For an array `a`, the index type can be any integer type `I` where +`a.length <= I.max`. + +Other cases [are not implemented](https://issues.dlang.org/show_bug.cgi?id=24542) yet.