The rhs of the conditional expression appears to be evaluated regardless of the condition. This should not happen if the condition is known at compile-time.
Environment
Compiler version: 0.8.7
Operating system: Ubuntu
Steps to Reproduce
def main() {
field[2] a = [0; 2];
for u32 i in 1..2 {
field b = (i == 1) ? 0 : a[i - 2];
}
}
Error: Out of bounds index (4294967295 >= 2) found during static analysis
Description
The rhs of the conditional expression appears to be evaluated regardless of the condition. This should not happen if the condition is known at compile-time.
Environment
Steps to Reproduce
Error:
Out of bounds index (4294967295 >= 2) found during static analysis