# XO0421: integer literal does not fit its type

An integer literal takes the integer type expected in context (`Int` by default), and its value must fit that type: `300` is not an `Int8`, `9223372036854775808` is not an `Int`, and a negative literal is not an unsigned type. A minus written directly on the literal makes a negative literal, so a type's minimum is written `-128` or `-9223372036854775808`; with parentheses, `-(128)`, the literal must fit alone. See core 1.6.

## Example

```xo
fn main(os: Os) {
  let b: Int8 = 300
  os.stdio.println("${b}")
}
```

## Fix

```xo
fn main(os: Os) {
  let b: Int16 = 300
  os.stdio.println("${b}")
}
```

Run `xo explain XO0421` for this text in a terminal, or see
[section 10.6 of the specification](../../spec/core/#106-diagnostic-codes).

