E4137#
Range operators are currently only supported in for .. in loops.
This means you cannot save the range operator in a variable or use it later in other contexts.
Erroneous example#
fn main {
let range = 0..<10 // Error: Range operators are currently only supported in `for .. in` loops.
}
Suggestion#
One can use the until method to generate a range of numbers: