Bug 6867 – inout and nested foreach loops

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
Linux
Creation time
2011-10-30T11:21:00Z
Last change time
2011-10-31T12:12:00Z
Keywords
patch, rejects-valid
Assigned to
nobody
Creator
siegelords_abode

Comments

Comment #0 by siegelords_abode — 2011-10-30T11:21:41Z
DMD version: 2.056 inout(char)[] test(inout(char)[] a) { foreach(dchar d; a) // No error if 'dchar' is removed { foreach(c; a) // line 5 { } } return []; } test.d(5): Error: variable test.test.__foreachbody3.__aggr4 inout variables can only be declared inside inout functions test.d(5): Error: variable test.test.__foreachbody3.c inout variables can only be declared inside inout functions
Comment #1 by k.hara.pg — 2011-10-30T12:32:43Z
Comment #2 by bugzilla — 2011-10-31T12:12:00Z