From d-bugmail at puremagic.com Fri Aug 8 10:35:02 2025 From: d-bugmail at puremagic.com (d-bugmail at puremagic.com) Date: Fri, 08 Aug 2025 10:35:02 +0000 Subject: [Issue 24499] foreach over a ref parameter to an rvalue should be an error In-Reply-To: References: Message-ID: https://issues.dlang.org/show_bug.cgi?id=24499 --- Comment #4 from Dlang Bot --- @ntrel created dlang/dmd pull request #21674 "Deprecate `ref` for range foreach parameter" fixing this issue: - Deprecate `ref` for range foreach parameter Fix Bugzilla 24499 - foreach over a ref parameter to an rvalue should be an error Allow struct variable to be `ref` to avoid destructor call on each iteration. https://github.com/dlang/dmd/pull/21674 --