core
core copied to clipboard
Bug about range
for i in 9..=0 {
println(i)
}
Range does not support iterating from large to small, but there is no compilation error.
How could the compiler knows if you have:
let start = fetch("www.example.com/a/number").await!()
let end = fetch("www.example.com/another/number").await!()
for i in start..<end {
}
At least we can report warning on constant one?
Then should we report warning for these cases as well
for i = 0; i < 0; i = i + 1 {
}
for i = 0; i < -1; i = i + 1 {
}
while false {
}
I think this is a lint issue, shouldn't it be reported at the compiler level?
Since it's a lint issue, we'll handle it with linter @myfreess