[Issue 5906] Just pre-conditions at compile-time when arguments are static
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Mar 7 19:29:42 PST 2013
http://d.puremagic.com/issues/show_bug.cgi?id=5906
--- Comment #11 from bearophile_hugs at eml.cc 2013-03-07 19:29:40 PST ---
(In reply to comment #10)
> If the pre-condition analysis (constant folding) is done after a normal step of
> dead branch removal, then maybe that error will not be shown.
Currently it doesn't happen, and this generates an error (you need a "static
if" to make the error go away):
import std.typetuple;
void main() {
int[4] a;
foreach (i; TypeTuple!(1, 2, 3, 4)) {
if (i != 4)
a[i]++;
}
}
--
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