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: [email protected]
Reporter: [email protected]
The following fails to compile:
void test() {
int[] a;
foreach (scope e; a)
{
}
}
but ref, enum, alias, const, immutable, shared, and inout work.
--
