[Issue 4090] No foreach type inference with const, ref etc modifiers
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Nov 5 04:23:26 PST 2012
http://d.puremagic.com/issues/show_bug.cgi?id=4090
bearophile_hugs at eml.cc changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |RESOLVED
Resolution| |FIXED
--- Comment #10 from bearophile_hugs at eml.cc 2012-11-05 04:23:23 PST ---
void main() {
foreach (const i; 0 .. 10)
i++;
}
Now it prints both the warning and the error:
test.d(3): Warning: variable modified in foreach body requires ref storage
class
test.d(3): Error: cannot modify const expression i
Closed again. Thank you Hara, Don, yebblies, and others.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list