# E4146

Type is not supported by range pattern.

MoonBit only support range pattern for integer types. This error occurs when
you try to use a type that is not an integer in a range pattern.

## Erroneous example

```{literalinclude} /sources/error_codes/4146_error/top.mbt
:language: moonbit
```

## Suggestion

For type that is not an integer but implements the `Compare` trait, you can use
multiple `if-else` expression to achieve the same effect.

```{literalinclude} /sources/error_codes/4146_fixed/top.mbt
:language: moonbit
```
