E0025
Comparison chain that turns around
ErrorA chain of < and <=, or of > and >=, goes in one direction. Mixing the two directions is an error.
Why
a < b > c compares a with b and b with c, but says nothing about a and c, which makes a chain hard to read. Sisu allows only the chains that read like an ordering, such as a < b <= c.
Broken
fn main() {
let a = 1
let b = 2
let c = 1
print(a < b > c)
}
What sisu says
error[E0025]: a comparison chain must go in one direction --> E0025.sisu:5:17 | 5 | print(a < b > c) | ^ sisu: 1 error sisu: for more on a code, run `sisu explain <code>`: E0025
Fixed
fn main() {
let a = 1
let b = 2
let c = 1
print(a < b && b > c)
}
Sisu