Bug 1615 – inout is allowed in foreach of string literal

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2007-10-27T11:10:00Z
Last change time
2014-02-24T15:33:51Z
Keywords
accepts-invalid
Assigned to
bugzilla
Creator
ary

Comments

Comment #0 by ary — 2007-10-27T11:10:29Z
The following code compiles: --- void main() { foreach(inout char x; "hola") { x = '?'; } } --- But I think an error should be pointed, because x cannot be inout since the source aggregate is a string literal, which is immutable.
Comment #1 by smjg — 2007-11-08T15:15:03Z
This is closely related to issue 1322 - the difference is that this applies to D 1.x as well.
Comment #2 by bugzilla — 2008-09-03T01:40:06Z
Fixed dmd 2.019