From bc39d8014751b1d0ffcaa7fbb9fee5596e0d339b Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Tue, 16 Apr 2024 20:53:36 +0100 Subject: [PATCH] [spec/statement] ForeachRangeStatement variable cannot be `ref` See https://github.com/dlang/dmd/pull/16381. --- spec/statement.dd | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/statement.dd b/spec/statement.dd index cfc0ea78bf..175d25f74a 100644 --- a/spec/statement.dd +++ b/spec/statement.dd @@ -1207,7 +1207,9 @@ $(GNAME ForeachRangeStatement): The $(I ScopeStatement) is then executed $(I n) times, where $(I n) is the result of $(I UprExpression) `-` $(I LwrExpression). If $(I UprExpression) is less than or equal to $(I LwrExpression), - the $(I ScopeStatement) is not executed.) + the $(I ScopeStatement) is not executed. + $(I ForeachType) cannot be declared with `ref`. + ) $(P If $(I Foreach) is $(D foreach), then the variable is set to