E3801

E3801#

Compiler diagnostic name: inclusive_range_pattern_missing_equal.

Range pattern is missing =.

Range patterns must spell out whether the upper bound is inclusive or exclusive. Use a..=b for an inclusive range and a..<b for an exclusive range.

Erroneous example#

fn classify(x : Int) -> Unit {
  match x {
    1..2 => ()
    _ => ()
  }
}

1..2 is not accepted as a pattern because it does not say whether 2 is included.

Suggestion#

Choose an inclusive or exclusive range pattern explicitly.

fn classify(x : Int) -> Unit {
  match x {
    1..=2 => ()
    _ => ()
  }
}