July 23, 2021 [Issue 22138] New: foreach cannot declare the loop variables as scope | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=22138 Issue ID: 22138 Summary: foreach cannot declare the loop variables as scope Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: bugzilla@digitalmars.com The following fails to compile: void test() { int[] a; foreach (scope e; a) { } } but ref, enum, alias, const, immutable, shared, and inout work. -- | ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply