May 07 [Issue 24542] New: actually apply VRP to foreach indices when array is of known length | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=24542 Issue ID: 24542 Summary: actually apply VRP to foreach indices when array is of known length Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: qs.il.paperinik@gmail.com Follow-up to Issue 24450 ```d foreach (int i, int x; cond() ? [1,2,3] : [1,2]) { } ``` should likewise not be an error. The length is not known, but is bounded the same way `cond() ? 3 : 2` is bounded, and VRP detects that. -- |
Copyright © 1999-2021 by the D Language Foundation