E4138

E4138#

Range operators only support builtin integer types, they cannot be used on this type.

Erroneous example#

For example, you cannot use Float nor Double with range operators.

fn main {
  for _ in 0.0..<1.0 {
    ()
  }
}

Suggestion#

Use integer types for the range operators, and generate floats from these integers instead:

fn main {
  for  in 0..<10 {
    (::())
  }
}

You can also use until to construct a range of numbers:

pub fn () ->  {
  let  : [] = (0).(10)
  for  in  {
    (::())
  }
}